You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
The text was updated successfully, but these errors were encountered:
hunhoffe
changed the title
Proposal: SEED Code Quality Enhancements
Proposal: Code Quality Enhancements
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)
NotImplementedError
s. 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 functionseed-emulator/seedemu/core/Binding.py
Line 31 in 3749042
Use static tools to standardize code formatting and catch type errors (PR 2)
Automated Testing & Additional Tests (PR 3)
Document Generation and Hosting (PR 4)
The text was updated successfully, but these errors were encountered: