-
Notifications
You must be signed in to change notification settings - Fork 14
Node main function is not designed or written well #71
Comments
7a32c61 is an example of this problem, |
Generation of the UML diagram is simply an implementation of this library https://github.com/adjivas/ml, as specified on Line 1 of build.rs https://github.com/Drops-of-Diamond/diamond_drops/blob/develop/node/build.rs#L1. The "Usage" instructions of that crate were followed https://github.com/adjivas/ml#usage, hence why a If you desperately need to temporarily disable use of that build.rs file and the associated crate that generates the UML diagram to isolate it and ensure it isn't the cause of any errors that may arise due to new changes made to the codebase, then you would just comment out Line 6 https://github.com/Drops-of-Diamond/diamond_drops/blob/develop/node/Cargo.toml#L6 and Line 15-16 https://github.com/Drops-of-Diamond/diamond_drops/blob/develop/node/Cargo.toml#L15 in /node/Cargo.toml I agree it would be good to refactor the contents of the main function into a separate function with a meaningful name as you've mentioned
I agree that additional error handing (using |
Thanks for the tip! It wasn't due to build.rs and MML, but your suggestion helped to find and fix the error! I have also modified this in |
The above refactor is added in #73. |
Is your feature request related to a problem? Please describe.
The node crate has a main function which only contains functionality for building the UML diagram. This is problematic because it doesn't adequately link to the rest of the functionality in the crate, and there is no error handling, which makes it very difficult to fix errors when a panic occurs, as has happened a few times now, and then I have had to spend hours trying to find the cause of the error by trial and error. Additionally, this also points to the need to do test-driven development, which may seem to be harder, but may be worth it in the long run.
Describe the solution you'd like
Write a new main function and rename the current one to
make_uml_diagram
. Strive to do TDD from now on; it will probably only get harder the longer we put off doing that.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: