-
Notifications
You must be signed in to change notification settings - Fork 402
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
chore: general simplifications and cleanup #255
Conversation
* Use simplified logic checks * Use list and dict comprehension * Return value directly
Nothing functional just code style @heitorlessa |
Codecov Report
@@ Coverage Diff @@
## develop #255 +/- ##
===========================================
- Coverage 99.81% 99.81% -0.01%
===========================================
Files 76 76
Lines 2772 2750 -22
Branches 112 112
===========================================
- Hits 2767 2745 -22
Misses 4 4
Partials 1 1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👌 , @michaelbrewer just a question for my understanding did you replaced the variable assignment by using the return
for another reason other than a style change?
I have read that variable assignment can be memory expensive so just wondering if reducing the memory footprint was a motive of this change as well?
It also reduces the number of operations, maybe it is from my old java days when the compiler was not as smart. But to me it seems like an useless assignment that you just return immediately. |
Co-authored-by: Joris Conijn <[email protected]>
Co-authored-by: Joris Conijn <[email protected]>
@Nr18 does this look good otherwise. Maybe @heitorlessa can have a check as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hey @michaelbrewer thanks a lot! I'll go over that tomorrow - At a quick glance, some are great while others can make debugging difficult (e.g. logger X-Ray trace ID). |
Misread the tracer getenv line diff so we're good. I left others so we can actually fix the readability in finding a better formatter (Black) configuration -- here's an example where I personally think we lost readability to an extent, as the gain is minimal (perf, mem): Before for record in parsed_envelope.Records:
output.append(self._parse(data=record.Sns.Message, model=model))
return output After return [self._parse(data=record.Sns.Message, model=model) for record in parsed_envelope.Records] I'll create an issue to ensure these get adjusted automatically next time. Thanks again @michaelbrewer and @Nr18, much appreciated! |
* develop: chore: general simplifications and cleanup (#255)
* develop: chore: move env names to constant file (#264) docs: fix import (#267) feat: Add AppConfig parameter provider (#236) chore: update stale bot improv: override Tracer auto-capture response/exception via env vars (#259) docs: add info about extras layer (#260) feat: support extra parameter in Logger messages (#257) chore: general simplifications and cleanup (#255)
Issue #, if available:
Description of changes:
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.