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

Update analyzer tutorial #23066

Merged
merged 17 commits into from
Mar 8, 2021
Merged

Update analyzer tutorial #23066

merged 17 commits into from
Mar 8, 2021

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Mar 2, 2021

Fixes #23014
Fixes #22183
Fixes #20403

TODO: Completely address #17779, currently I partially addressed it. See #17779 (comment)

Note: I intentionally removed the projects from dependabot config instead of updating their paths to make sure we don't upgrade while the default VS template isn't.

@Youssef1313
Copy link
Member Author

Youssef1313 commented Mar 2, 2021

The current tests use DataRow to combine all no diagnostic cases in a single test, and all diagnostic cases in a single test.

The article says:

For efficiency, the first step is to refactor the two tests into data driven tests. Then, you only need to define a couple string constants for each new test.

I feel the code is losing readability this way. Should I re-write each test case separately (the same way roslyn and roslyn-analyzers, and mostly any other 3rd-party library write tests)?

cc: @BillWagner @sharwell

@Youssef1313 Youssef1313 changed the title Initial work for analyzer tutorial Update analyzer tutorial Mar 2, 2021
@Youssef1313 Youssef1313 marked this pull request as ready for review March 2, 2021 11:58
@Youssef1313 Youssef1313 requested review from BillWagner, IEvangelist and a team as code owners March 2, 2021 11:58
<configuration>
<packageSources>
<clear />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
Copy link
Member

Choose a reason for hiding this comment

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

📝 There's a pretty good chance parts of this won't work for people without a NuGet.org line

Copy link
Member Author

@Youssef1313 Youssef1313 Mar 2, 2021

Choose a reason for hiding this comment

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

@sharwell This is what the latest template updates have after dotnet/roslyn-sdk#725.

I actually opened an issue dotnet/roslyn-sdk#742 for one case which this wouldn't work.

Explicitly adding nuget.org feed can cause an issue if a customer decided to rely on XliffTasks package, which doesn't exist on NuGet.org yet, but exists in dotnet feeds.

Copy link
Member

Choose a reason for hiding this comment

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

Once we resolve this question, this is ready to merge.

@sharwell, what do you recommend here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@BillWagner Is it possible to address this in a follow-up in case dotnet/roslyn-sdk#742 takes some time?

Copy link
Member

Choose a reason for hiding this comment

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

@Youssef1313 @sharwell Yes, I'm happy with that plan. I'll plan on merging later today, unless Sam disagrees.

@sharwell
Copy link
Member

sharwell commented Mar 2, 2021

I feel the code is losing readability this way. Should I re-write each test case separately (the same way roslyn and roslyn-analyzers, and mostly any other 3rd-party library write tests)?

I agree we should switch to the form everyone actually uses (as appears to now be done).

@Youssef1313 Youssef1313 closed this Mar 3, 2021
@Youssef1313 Youssef1313 reopened this Mar 3, 2021
Base automatically changed from master to main March 5, 2021 23:33
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This is a very impressive body of work @Youssef1313
Thank you! I'll :shipit: now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants