Skip to content

Conversation

tamasvajk
Copy link
Contributor

@tamasvajk tamasvajk commented Feb 17, 2021

This PR is the fourth in multiple steps to enable nullability analysis and remove nullability warnings. It's based on #5189. This PR enables nullability analysis on the Extraction.CSharp project. I added some #nullable disable warnings directives where I couldn't get around some warnings. The biggest such section is in the Analyser.cs, where we have a two phase initialization with the InitializeStandalone/EndInitialize, and therefore we have a lot of nullable fields. I think it's not worth the effort to try to fix these. (It seems quite cumbersome to do it without changing our log messages, which might be considered a breaking change.)

The last commit is independent of nullability analysis. It combines the standalone and normal analysis into a single method. However, it needs quite a few Func/Action parameters, so in the end it didn't help too much with readability. Nevertheless, I think it would make sense to combine these two paths.

Differences job Differences job Differences job

@github-actions github-actions bot added the C# label Feb 17, 2021
@tamasvajk tamasvajk changed the title C#: Enable nullability in csharp extraction project v1 C#: Enable nullability in Extraction.CSharp Feb 18, 2021
@tamasvajk tamasvajk force-pushed the feature/refactor-4 branch 3 times, most recently from 89fca5d to ff858b5 Compare February 25, 2021 13:33
@tamasvajk tamasvajk marked this pull request as ready for review February 26, 2021 07:20
@tamasvajk tamasvajk requested a review from a team as a code owner February 26, 2021 07:20
@tamasvajk tamasvajk force-pushed the feature/refactor-4 branch from ff858b5 to bd2b3e7 Compare March 3, 2021 13:35
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Looks good to me; a few minor suggestions.

});
}

private static ExitCode AnalyseNonStandalone(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be in NonStandaloneExtractor.cs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't want to change even more things. I think the best would be to get rid of the public static class Extractor altogether and move its bits maybe to StandaloneAnalyser and TracingAnalyser.

return analyser.TotalErrors == 0 ? ExitCode.Ok : ExitCode.Errors;
}

private static void AnalyseStandalone(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be in StandaloneExtractor.cs?

@tamasvajk tamasvajk merged commit 23d994a into github:main Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants