Skip to content

[Refactor] Restructure Provider code and tests #812

Closed
@davidlday

Description

@davidlday

Description

Currently, all version providers are in a single file version_providers.py and all tests for them are in a single file test_version_providers.py. Working with the code, it already feels a little bloated. And both files will continue to grow as new providers are added. I'd like to split providers and related tests in to more granular, provider specific files.

Possible Solution

I would envision laying provider code out as such:

commitizen/
├─ .github/
├─ commitizen/
│  ├─ commands/
│  ├─ config/
│  ├─ cz/
│  ├─ providers/
│  │  ├─ base.py # Abstract and base classes go here
│  │  ├─ cargo.py
│  │  ├─ commitizen.py
│  │  ├─ composer.py
│  │  ├─ npm.py
│  │  ├─ pep621.py
│  │  ├─ poetry.py
│  │  ├─ scm.py
│  ├─ templates/
...
├─ docs/
├─ hooks/
├─ scripts/
├─ tests/
│  ├─ commands/
│  ├─ data/
│  ├─ providers/
│  │  ├─ test_cargo.py
│  │  ├─ test_commitizen.py
│  │  ├─ test_composer.py
│  │  ├─ test_npm.py
│  │  ├─ test_pep621.py
│  │  ├─ test_poetry.py
│  │  ├─ test_scm.py

Additional context

Happy to do the work on this one.

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions