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

Allow Inject-Tags if types using them are referenced in a Provider-Function #2

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

domeej
Copy link
Member

@domeej domeej commented Aug 19, 2021

No description provided.

Works in the test file but somehow not when running on the whole project

added testfile

POC: provider binding test

Done

documentation

removed todo

changed error description to match provider errors too

cleanup
@domeej domeej force-pushed the provider-binding-second-attempt branch from faa854f to 417475e Compare August 19, 2021 14:10
src/analyzers/dingo/checks/helper/get_configureMethods.go Outdated Show resolved Hide resolved
)

// helper analyzer which returns all function declarations
var ConfigureDeclAnalyzer = &analysis.Analyzer{
Copy link
Member

Choose a reason for hiding this comment

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

Not so happy that this is listed within the checks then. But for now it ts ok i think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm probably move it to analyzers/dingo? I think it should stay somewhere below dingo though

src/analyzers/dingo/globals/globals.go Show resolved Hide resolved
src/analyzers/dingo/checks/inject/proper_tags.go Outdated Show resolved Hide resolved

func (d *D) Configure(injector *dingo.Injector) bool {
injector.Bind(new(interface{})).ToProvider(providerFunc)
injector.BindMulti(new(interface{})).ToProvider(d.providerFuncWithSelector)
Copy link
Member

Choose a reason for hiding this comment

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

Let's also add a BindMap here for completeness.

Copy link
Member

Choose a reason for hiding this comment

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

What about split declarations like

bind := injector.Bind(new(interface{}))
bind.ToProvider(providerFunc)

?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point and something we doesn't check rn. Same for the binding_implements_interface analyzer, would be something I can jump on next

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.

2 participants