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

Proposal: Code Quality Enhancements #142

Open
hunhoffe opened this issue Mar 7, 2023 · 1 comment
Open

Proposal: Code Quality Enhancements #142

hunhoffe opened this issue Mar 7, 2023 · 1 comment

Comments

@hunhoffe
Copy link

hunhoffe commented Mar 7, 2023

As seed-emulator grows, I thought it might be useful to suggest a few PRs for general code improvement and maintenance. I may work slow, but if the seed devs agree that these are good ideas, I am happy to work on these PRs as time allows.

Use standard libraries for logging and inheritance (PR 1)

  • Remove use of individually created logging functions in favor of using the logging library
    • Using the logging library will reduce the number of logging functions, which should reduce lines of code in seed-emulator
    • Using a centralized to configure logging for the entire library just once will make it easier to log to a file or stdout. Right now, if you wanted to do that, you'd have to manually change stderr to something else in every individual logging function.
  • Use abc python library for inheritance
    • Currently, for methods that subclasses should implement, seed uses NotImplementedErrors. When an unimplemented method is called, the error will be thrown. Instead, using the abc @abstractmethod decorator on abstract function, an error about missing implementations will be thrown as soon as a subclass is instantiated. This will avoid subtle bugs that are currently uncaught, like the Filter class being marked as printable but not actually implementing the print function
      class Filter(Printable):

Use static tools to standardize code formatting and catch type errors (PR 2)

  • Add code style linter as GitHub action, with instruction in README for running manually during development
    • There are many options for linters, but I was thinking Black might be a good option
  • Add python static type checking as GitHub action, with instruction in README for running manually during development
    • There are probably other tools but I was thinking mypy might be a good option.

Automated Testing & Additional Tests (PR 3)

  • Add existing SEED example-based tests as GitHub action
    • I believe these more fall under Integration Tests than Unit Tests, although I think it’s perfectly acceptable to use the unit test library to implement them
    • I haven't thought too much about what additional testing might look like, so I'll leave this open.
  • Add unit tests to various classes & add as GitHub action

Document Generation and Hosting (PR 4)

  • Create a github action that checks for documentation errors when building with doxygen
  • It should be possible to serve the doxygen docs using github pages, with updates automatically on merging PRs into main
@hunhoffe hunhoffe changed the title Proposal: SEED Code Quality Enhancements Proposal: Code Quality Enhancements Mar 7, 2023
@kevin-w-du
Copy link
Member

These are very good ideas. We look forward to your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants