Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

clear way to manage settings #425

Closed
Lee-W opened this issue Sep 25, 2021 · 10 comments
Closed

clear way to manage settings #425

Lee-W opened this issue Sep 25, 2021 · 10 comments
Assignees
Labels
type: feature A new enhacement proposal

Comments

@Lee-W
Copy link
Member

Lee-W commented Sep 25, 2021

Description

currently, we use dict to dynamically manage our settings/configurations which makes it a bit hard to maintain if any new settings are to introduce

Possible Solution

  1. list all the available settings and use typedict

Additional context

Related Issue

@Lee-W Lee-W added the type: feature A new enhacement proposal label Sep 25, 2021
@Lee-W Lee-W self-assigned this Sep 25, 2021
@Lee-W
Copy link
Member Author

Lee-W commented Sep 25, 2021

This also relates to #153 as most of the untyped parts are from configurations.

Also, #300

@woile
Copy link
Member

woile commented Sep 25, 2021

I'd avoid introducing more dependencies if possible and potentially use dataclasses instead.
Or typeddict.

I'm wondering also, would it be possible to easily add new settings when creating a custom commitizen?

@Lee-W
Copy link
Member Author

Lee-W commented Sep 25, 2021

I'd avoid introducing more dependencies if possible and potentially use dataclasses instead.
Or typeddict.

Let's try TypeDict first then. It would be easier than using dataclasses. we can migrate to dataclass if we find it more maintainable.

I'm wondering also, would it be possible to easily add new settings when creating a custom commitizen?

not sure, but that's part of the goal of this refactor as well

@josix
Copy link
Contributor

josix commented Sep 26, 2021

I would take this issue in the sprint of PyConTW'21.

@Lee-W
Copy link
Member Author

Lee-W commented Sep 26, 2021

Hi @josix , I'm actually working on it. Which part do you want to start from? Maybe we could split our effort.

@Lee-W Lee-W removed the pycontw2021 label Sep 27, 2021
@josix
Copy link
Contributor

josix commented Sep 28, 2021

I would like to use TypedDict to define the available fields for JSON, YAML, TOML config first.

@Lee-W
Copy link
Member Author

Lee-W commented Sep 28, 2021

Sure :) Then, I'll focus on other parts first. I'm thinking of creating another feature branch and merge it once we finish all the refactoring.

@woile
Copy link
Member

woile commented Apr 28, 2023

Both of this are typedict now

CzSettings
Settings

closing as it looks like it was fixed.

Feel free to open again if I made a mistake

@woile woile closed this as completed Apr 28, 2023
@Lee-W
Copy link
Member Author

Lee-W commented May 6, 2023

Yep, it looks better than it was. I think the next step is moving some conventional commit defaults out of the global default. But we could create another issue for that

@woile
Copy link
Member

woile commented May 6, 2023

Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new enhacement proposal
Projects
None yet
Development

No branches or pull requests

3 participants