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

Review sopel.config for dead/outdated code #2556

Open
SnoopJ opened this issue Nov 11, 2023 · 0 comments
Open

Review sopel.config for dead/outdated code #2556

SnoopJ opened this issue Nov 11, 2023 · 0 comments
Labels
Housekeeping Code cleanup, removal of deprecated stuff, etc.
Milestone

Comments

@SnoopJ
Copy link
Contributor

SnoopJ commented Nov 11, 2023

It was pointed out on IRC that sopel.Config.CoreSection uses a narrow type-check for lists rather than isinstance(), and somewhat surprisingly, it turns out that this code is not currently under coverage by the test suite. The code is 11 years old, so it's possibly vestigial in nature, but investigation into whether or not this should be considered a bug (i.e. whether one could do cfg.core.somefield = MyListSubtype(...)) turned into a broader discussion about dead code in the config machinery.

For whatever it's worth, testing with cfg.core.enable = ... confirms that subtypes of list are accepted, although sequence types that are coercible to list (in particular tuple) are not accepted. Debatable whether or not this is a feature or a bug, but the early view seems to be that this is fine for ListAttribute which is pretty specifically about lists.

This issue is a placeholder for the intent to sweep for old code in the config machinery. A very optimistic goal for closure would be to get coverage of the config machinery up to 100%, probably a combination of removing dead code and improved testing.

@SnoopJ SnoopJ added the Housekeeping Code cleanup, removal of deprecated stuff, etc. label Nov 11, 2023
@SnoopJ SnoopJ added this to the 8.1.0 milestone Nov 11, 2023
@SnoopJ SnoopJ changed the title Review Config, CoreSection for dead/outdated code Review sopel.config for dead/outdated code Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping Code cleanup, removal of deprecated stuff, etc.
Projects
None yet
Development

No branches or pull requests

1 participant