Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Refactor: shorten & un-nest functions, re-think return values #180

Closed
2 of 4 tasks
Lotterleben opened this issue Mar 31, 2021 · 5 comments
Closed
2 of 4 tasks

Refactor: shorten & un-nest functions, re-think return values #180

Lotterleben opened this issue Mar 31, 2021 · 5 comments
Labels
difficulty: medium Somewhat difficult to solve priority: medium Medium priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: enhancement Enhancement or feature request

Comments

@Lotterleben
Copy link

Lotterleben commented Mar 31, 2021

Opening this issue for visibility (and also because I'd like to do this :D)
Imo it'd help with readability and maintainability to do a refactoring run.

Things that I've been bumping into:

  • checks in notmain() could be pulled into separate functions for readability
  • construct_backtrace() is pretty long and involved; amount of parameters is smelly
  • construct_backtrace() always returns OK, even if there was an exception (then it's an OK(Some(TopException))). Returning a Result<(), TopException> would be more intuitive imo, but this could also be that I'm misunderstanding anyhow::Error
  • update_cfa()has another unintuive return value, could be Option<new_cfa> imo

These can also be sneaked in as drive-bys on bugfixes and feature implementation.

@Urhengulas Urhengulas added difficulty: medium Somewhat difficult to solve priority: medium Medium priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: enhancement Enhancement or feature request labels Mar 31, 2021
@Urhengulas
Copy link
Member

Totally agree that there is room for quite some refactoring!

Also we might want to add some unit, but also end-to-end tests. Maybe the kind of @jonas-schievink described in the github-actions blog Post :)

@Lotterleben
Copy link
Author

very much agreed! I've tracked that one in #173 :D Maybe we can chat about planning/funds for this in the next bi-weekly?

@japaric
Copy link
Member

japaric commented May 12, 2021

construct_backtrace was refactored in PR #197

@Urhengulas
Copy link
Member

@Lotterleben Do you consider this resolved by #222?

@Lotterleben
Copy link
Author

very much so! thanks for the bump

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficulty: medium Somewhat difficult to solve priority: medium Medium priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: enhancement Enhancement or feature request
Projects
None yet
Development

No branches or pull requests

3 participants