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

GCP Cloud Functions #529

Closed
wants to merge 6 commits into from
Closed

GCP Cloud Functions #529

wants to merge 6 commits into from

Conversation

bruno-garcia
Copy link
Member

Hit this GoogleCloudPlatform/functions-framework-dotnet#145 while trying this out.

@bruno-garcia bruno-garcia changed the title Feat/gcp cloud functions GCP Cloud Functions Sep 27, 2020
@bruno-garcia
Copy link
Member Author

bruno-garcia commented Sep 27, 2020

Now missing some tests, and a refactor for the part I copied over from ASP.NET Core, to be reused there and avoid that duplication

and setting sdk-name, and packages

@Tyrrrz
Copy link
Contributor

Tyrrrz commented Sep 28, 2020

Do you have some analyzer that requires you to write _ = expression? I've seen it around the code. It's a bit weird, as very few methods that return something are actually pure in C#.

@bruno-garcia
Copy link
Member Author

@Tyrrrz .editorconfig
I adopted that recently even though Rider isn't nagging me, but I was hoping to be clear to when we discard returns.

Strong feels against this?

@Tyrrrz
Copy link
Contributor

Tyrrrz commented Sep 29, 2020

Yes, I don't think it adds value. It makes sense for pure functions (i.e. marked with [Pure]) but then you would never want to discard the return anyway. For impure functions, disgarding the return value often makes sense (which is evident by the fact that you very often do _ =). I think it just adds noise and nothing else.

I can't imagine a situation where that rule is helpful.

@bruno-garcia
Copy link
Member Author

Discarding a Task is a valuable example. Do we have broken build or a warning if we don't discard it today?

@bruno-garcia
Copy link
Member Author

Work around on msbuild can be deleted: GoogleCloudPlatform/functions-framework-dotnet#145

@Tyrrrz
Copy link
Contributor

Tyrrrz commented Oct 1, 2020

Discarding a Task is a valuable example. Do we have broken build or a warning if we don't discard it today?

Not sure about build, but Rider will definitely warn against it. If Task is the only such example, it doesn't make sense to add noise for all other types of expressions.

@bruno-garcia
Copy link
Member Author

bruno-garcia commented Oct 2, 2020

Task is the biggest example I can think of. I don't have strong feelings about this, we can drop it.
I don't find it noise tbqh, I find that I can spot by readin the code outside an IDE (I do it more often than now these days) that the method indeed returns something but it's not used.

ALso it becomes clear that it's not an accident that the return isn't being used.

If that's just something that bothers you, feel free to open a PR deleting all cases and dropping the .editorconfig setting. Also feel free to merge without PR approval

@bruno-garcia
Copy link
Member Author

6th sense eh? 12 hours ago:

image

@Tyrrrz
Copy link
Contributor

Tyrrrz commented Jun 23, 2021

6th sense eh? 12 hours ago:

image

Damn, you really foresaw it 9 months ago 😂

@bruno-garcia bruno-garcia mentioned this pull request Jun 24, 2021
5 tasks
@bruno-garcia bruno-garcia deleted the feat/gcp-cloud-functions branch June 24, 2021 03:16
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