Skip to content

CRASH on cargo provider #2001

Description

@vemilano

Description

Hello,

In cargo_provider.py on line 86, there is version_workspace = package_content["version"]["workspace"].
This causes commitizen to crash (traceback) under the following conditions:

  • you have a cargo workspace
  • you have a crate that is a worskpace member
  • this crate has (in [package] key) a version = 0.1.0

The error is: TypeError: string indices must be integers, not 'str'

This could be fixed by checking that workspace key exists (and check that it is True, which is already done)

Steps to reproduce

  • you have a cargo workspace
  • you have a crate that is a worskpace member
  • this crate has (in [package] key) a version = 0.1.0

Current behavior

TypeError: string indices must be integers, not 'str'

Desired behavior

no crash

Screenshots

No response

Environment

Commitizen Version: 4.16.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions