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

Remove #nullable enable #17150

Closed
wants to merge 4 commits into from
Closed

Remove #nullable enable #17150

wants to merge 4 commits into from

Conversation

hishamco
Copy link
Member

@hishamco hishamco commented Dec 8, 2024

Seems the nullable attribute was added by Rider, no need for it while it's configured in .csproj

@hishamco hishamco requested a review from MikeAlhayek December 8, 2024 00:45
@MikeAlhayek
Copy link
Member

Why removing this?

@hishamco
Copy link
Member Author

hishamco commented Dec 8, 2024

Why removing this?

Check the issue description, moreover is makes the code-based inconsistent, I'm able to add the settings in the .csproj but the build will fail because we didn't use nullable before

Removing this easier than applying the nullable over the code-base

@MikeAlhayek
Copy link
Member

I don't think you should do this. At some point we may want to use nullable everywhere. Since it's already there, I would rather keep it

@hishamco
Copy link
Member Author

hishamco commented Dec 8, 2024

At some point we may want to use nullable everywhere

We can do it now if we do so, but no need to use the attribute anymore, using the csproj property is much better and cleaner

@MikeAlhayek
Copy link
Member

I would not proceed with this

@hishamco
Copy link
Member Author

hishamco commented Dec 8, 2024

Let's hear @sebastienros feedback, we already started months ago to make things consistent, so either we accept nullable or not but not using attribute

@gvkries
Copy link
Contributor

gvkries commented Dec 8, 2024

I'm against removing the ones we already have. If we completely want to enable nullable annotations some time in future, this is work that is already done. Enabling nullable for the whole project is also not an options, if only parts are done yet.

@Piedone
Copy link
Member

Piedone commented Dec 8, 2024

Agree with not doing this. We'll want to fully enable nullable in the future. Having a bit done now will help with that.

@hishamco
Copy link
Member Author

hishamco commented Dec 9, 2024

We'll want to fully enable nullable in the future

If we do so it's much better and cleaner to do it in .csproj as I said earlier

@Piedone
Copy link
Member

Piedone commented Dec 9, 2024

Yes, there's no disagreement there (or rather, it should be done solution-wide in a props file). But until then, we shouldn't revert nullable in those files that already have it, so then we have to reimplement these later.

@sebastienros
Copy link
Member

We could have reverted if all the types were marked with ?, but I don't think it's the case in this file.

it should be done solution-wide

That's the theory. That would be a pain though to do it correctly. Also would break all existing PRs. Could be done by modules or groups, could still impact lots of related projects though.

@gvkries
Copy link
Contributor

gvkries commented Dec 9, 2024

I think it makes sense to add nullable incrementally on a per file and/or module basis. It is just too much work to do it all at once. Then we can remove the pragmas per project step-by-step as well.

@hishamco
Copy link
Member Author

hishamco commented Dec 9, 2024

It could be done module by module as Seb refers to, but I suggest doing it before 3.0.0. Later such things will not acceptable because it will introduce a breaking changes

@Piedone
Copy link
Member

Piedone commented Dec 9, 2024

OK, but the point is, this PR isn't needed.

@hishamco
Copy link
Member Author

hishamco commented Dec 9, 2024

I will close this PR and file issue for tracking

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.

5 participants