pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.24k stars 124 forks source link

feat: Rework configuration setup to add validation #468

Closed jarviliam closed 6 months ago

jarviliam commented 6 months ago

Describe what this PR does / why we need it

This commit reworks the config setup structure and adds Config typing, validations and tests. On config setup the user's configuration will be validated against. Any type errors raised by invalid settings will result in a user-friendly error message being shown to the user. I've lifted a majority of it from another plugin (neogit) that I've contributed to before as It seems to work well.

I've run into issues in the past where my configuration was out of date and once I updated I'd have to track down the change and apply it. With this it should be a lot more easier to see the config issue.

This also adds much needed typing annotations and configuration tests to make it easier to detect regressions/unintended changes. I still need to add validations for the mappings but this is essentially the base of it.

pwntester commented 6 months ago

Thanks a lot @jarviliam this is an awesome contribution!