Skip to content
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

Function collections #156

Merged
merged 9 commits into from
Aug 16, 2021
Merged

Function collections #156

merged 9 commits into from
Aug 16, 2021

Conversation

meadsteve
Copy link
Owner

No description provided.

@@ -198,4 +198,5 @@ def reflection_cache_overview(self) -> Dict[str, str]:
SpecialDepDefinition[T], # From the definitions module
SpecialDepDefinition[NoReturn], # Some types don't resolve
T, # Just an instance of the type - A singleton
List[Callable], # A collection of functions - maps to FunctionCollection[F]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I don't need this "magic" at all 🤔

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I don't like this magic. I think I'll remove this and just provide FunctionCollection as a helper

"""

def __init__(self, *checkers: F):
self._checkers = checkers
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename it from checkers. This was from my project that I extracted it from

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 16, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 1.10%.

Quality metrics Before After Change
Complexity 1.06 ⭐ 0.86 ⭐ -0.20 👍
Method Length 18.68 ⭐ 16.17 ⭐ -2.51 👍
Working memory 4.03 ⭐ 3.56 ⭐ -0.47 👍
Quality 93.86% 94.96% 1.10% 👍
Other metrics Before After Change
Lines 149 183 34
Changed files Quality Before Quality After Quality Change
lagom/init.py 95.53% ⭐ 95.04% ⭐ -0.49% 👎
lagom/definitions.py 93.94% ⭐ 93.94% ⭐ 0.00%
lagom/util/functional.py 96.84% ⭐ 96.30% ⭐ -0.54% 👎
tests/util/test_functional.py 87.51% ⭐ 97.60% ⭐ 10.09% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@meadsteve meadsteve merged commit 4d577db into master Aug 16, 2021
@meadsteve meadsteve deleted the function-collections branch August 16, 2021 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant