Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Spring clean #82

@rakiru

Description

@rakiru

Eh, late Summer clean? Or more likely, Autumn to Winter clean. There's a lot of crap in utils that just got shoved there at the beginning without any real thought behind it. It may be worth having a scan through the rest of the code for less-than-stellar code (instance variables set to mutable type in class definition, for example (or even just instance variables referenced in class defs at all)). Perhaps Landscape might be useful for once.

Edit: Some possible changes too:

  • Rename command_manager to commands
    • Reasoning: command_manager.CommandManager is a bit redundant, and any other command-related stuff would probably go in there too. This could also be a full module rather than a single file.
  • Rename event_manager to events
    • Reasoning: Same as commands
  • Deprecate system.plugin
    Reasoning: It's just an import of system.plugins.plugin.PluginObject. We have a function decorator for deprecation, so we should make a class one and wrap this.
  • Rename Manager in factory_manager to FactoryManager
    • Reasoning: Overly generic name means you need the full module name to make any sense of it.
  • Move functionality of run.py into an Ultros class.
    • Reasoning: Cleaner, separates instantiation (args parsing, etc.) from bot setup and running. This would also be a sensible place to store/access references to subsystems were we to get rid of the singletons.
  • Discuss system.help
    • Reasoning: What even is this? We should probably discuss commands a bit to figure out how they would provide help topics and such.
  • Plugin cleanup
    • Different repo, but it's a cleanup thing. A bunch of plugins still import and grab instances to things such as the command and event manager. The plugin superclass has instances of these already now, so this unnecessary code should be stripped out of existing plugins.

Any renaming should be deprecated. Also, we should think up how to handle deprecation (when do we actually remove things?).

Other things to consider but should be discussed in separate tickets if/when tackled:

  • Rethink overzealous use of singletons.
  • Rethink Protocol reuse (same Protocol instance reused for every connection).
    • It didn't actually reuse them, but there was still some weird bullshit system for connections. Fixed with Unfuck factories #90.
  • Rethink translation system
    • Current one isn't very useful and underutilised. I think g said it was a bad system.
  • Rethink versioning
    • Lots of breaking changes without even bumping patch version, making them pretty useless.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26491528-spring-clean?utm_campaign=plugin&utm_content=tracker%2F269930&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F269930&utm_medium=issues&utm_source=github).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions