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

Add rule to warn against using scopes with assisted injection #171

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WhosNickDoglio
Copy link
Owner

@WhosNickDoglio WhosNickDoglio commented Jan 2, 2024

Description

Related Issue

Checklist

  • My code follows the style guidelines of this project (./gradlew lint spotlessCheck)
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I have mentioned changes in CHANGELOG.md.
  • I have read the CONTRIBUTING document.

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: Patch coverage is 95.65217% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.83%. Comparing base (c8e49c7) to head (cf0e61d).

Files with missing lines Patch % Lines
.../whosnickdoglio/dagger/DaggerRulesIssueRegistry.kt 0.00% 1 Missing ⚠️
...dagger/detectors/ScopedAssistedInjectedDetector.kt 97.77% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   89.47%   89.83%   +0.36%     
==========================================
  Files          21       22       +1     
  Lines         741      787      +46     
  Branches       82       84       +2     
==========================================
+ Hits          663      707      +44     
- Misses         50       51       +1     
- Partials       28       29       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 2 times, most recently from 04de865 to 271aa21 Compare January 5, 2024 17:48
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch from 271aa21 to 46e1b47 Compare January 13, 2024 18:17
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 3 times, most recently from 3b60a9c to 1624e34 Compare April 6, 2024 15:27
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 2 times, most recently from 82dba24 to 7f734fa Compare April 20, 2024 13:13
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch from 7f734fa to cace876 Compare April 27, 2024 19:58
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 2 times, most recently from c511b5e to 2c1c72e Compare June 1, 2024 03:28
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 2 times, most recently from 59dc186 to 9fc3830 Compare June 14, 2024 01:52
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 3 times, most recently from 139b8cb to 79b0160 Compare July 13, 2024 14:31
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch from 79b0160 to 7c9a297 Compare July 28, 2024 12:45
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch from 7c9a297 to 52b9587 Compare August 25, 2024 15:57
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 6 times, most recently from 0450deb to 6d489d7 Compare September 13, 2024 23:39
@@ -270,6 +270,14 @@ annotated with `@Inject` will be supplied.
More information here: [
`@Component` Dagger documentation](https://dagger.dev/api/latest/dagger/Component.html)

### Classes that use `@AssistedInject` cannot be scoped
Copy link
Owner Author

Choose a reason for hiding this comment

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

TODO make this not suck

Comment on lines +24 to +27
/**
* A Lint rule that warns if a class is annotated with any scope annotation but does not have a
* `@Inject` annotation on any constructor that it will not be added to the Dagger graph.
*/
Copy link
Owner Author

Choose a reason for hiding this comment

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

More docs

@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch from 6d489d7 to 1ede769 Compare October 19, 2024 02:58
@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch 2 times, most recently from 3c7e978 to 2c3e135 Compare November 2, 2024 16:30
Copy link
Contributor

github-actions bot commented Nov 2, 2024

Warnings
⚠️

Any major changes should be added to our CHANGELOG.md file
Changelog format is based on Keep a Changelog.

⚠️

This is a large pull request, can we break it down into multiple smaller PRs? Considering stacking them if that helps

Generated by 🚫 Danger Kotlin against cf0e61d

@WhosNickDoglio WhosNickDoglio force-pushed the feature/ndoglio/assisted-no-scoping branch from 2c3e135 to cf0e61d Compare November 16, 2024 20:58
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.

1 participant