-
Notifications
You must be signed in to change notification settings - Fork 27
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
Refactor 'generate_csv()' #9
Comments
We should be able to refactor this much more. Your ideas are good, but I am almost certain there is more that we can do. Right off the bat, the fact that we have to take 12 lines per 'category' to set each variable is very ugly. Also delta['old']['sha1'] is not a great way to reference values either. Since we are working with the dictionary from Give it a try and see what you can do. I can try and write up some examples if you need me too, but you will have to give me some time to dig around and test possible solutions. |
* Reduces 39-line code block to 12 lines. Signed-off-by: John M. Horan <johnmhoran@gmail.com>
Refactor generate_csv() using ternary operators #9
merged, closing this. |
I think we might be able to reduce the 38 or so lines used in
generate_csv()
to construct the.csv
tuple down to around 13 lines by using a ternary/conditional expression, e.g.,Initial testing suggests this works as expected -- all 45 tests pass. The refactoring would be applied here:
deltacode/src/deltacode/cli.py
Lines 26 to 66 in 551f231
The text was updated successfully, but these errors were encountered: