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

Port remaining FxCop rules into .NET as Roslyn Analyzers #61964

Open
17 of 31 tasks
Evangelink opened this issue Nov 23, 2021 · 17 comments
Open
17 of 31 tasks

Port remaining FxCop rules into .NET as Roslyn Analyzers #61964

Evangelink opened this issue Nov 23, 2021 · 17 comments
Assignees
Labels
area-Meta code-analyzer Marks an issue that suggests a Roslyn analyzer Epic Groups multiple user stories. Can be grouped under a theme. Priority:3 Work that is nice to have Team:Libraries
Milestone

Comments

@Evangelink
Copy link
Member

Evangelink commented Nov 23, 2021

In roslyn-analyzers there is a bunch of tickets open related to porting some old FxCop rules. Because most of these are dated from 2015, we were wondering if it would be worth having them under review as their relevance or the context in which they apply may have changed.

I have tried to filter down the ones related to .NET API but I may have missed or included incorrect ones (if you want to review them all, please look at https://github.com/dotnet/roslyn-analyzers/issues?q=is%3Aopen+label%3AFxCop-Port+-label%3A%22Needs-Fixer%22):

(tagging @mavasani )

Native resources/Interop

WinForms

Serialization

Others

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 23, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@mavasani
Copy link

@jmarolf @mikadumont

@stephentoub
Copy link
Member

We should just close any of these that are no longer relevant / stale / etc.

@AaronRobinsonMSFT / @jkoritzinsky / @elinor-fung to comment on the interop rules.

I suggest we close all of the serialization ones. We're in the process of deprecating BinaryFormatter, we're no longer encouraging implementation of ISerializable nor implementing it ourselves on new types, etc. @GrabYourPitchforks

@merriemcgaw for WinForms.

@jkotas jkotas added the code-analyzer Marks an issue that suggests a Roslyn analyzer label Nov 23, 2021
@Evangelink
Copy link
Member Author

@stephentoub Out of curiosity, are you simply no longer encouraging the implementation of ISerializable or shall we go even one step further and have analyzers guarding against (there could be a dotnet version check)?

@merriemcgaw
Copy link
Member

@RussKie can you look at the WinForms ones and see if they make any sense in the current context?

@GrabYourPitchforks
Copy link
Member

@Evangelink Basically, we're no longer marking any new types as [Serializable] or applying the ISerializable interface. There are some exceptions for the sake of compatibility, but those use cases are definitely in the minority.

@RussKie
Copy link
Member

RussKie commented Dec 6, 2021

WinForms:

These look worthy of a port.

Over the months we had several team discussions and bounced ideas about how we can enhance the developer and end user experiences with various Windows Forms analyzers. I also had an offline thread with @jmarolf @sharwell @mavasani about the same subject, and for the general purpose analyzers (like these) https://github.com/dotnet/roslyn-analyzers looked like a good home.

@AaronRobinsonMSFT
Copy link
Member

The Interop team has gone through the list. The below list contains what we think makes sense to port. All others can be closed.

dotnet/roslyn-analyzers#420
dotnet/roslyn-analyzers#421
dotnet/roslyn-analyzers#425
dotnet/roslyn-analyzers#428
dotnet/roslyn-analyzers#430

@Evangelink
Copy link
Member Author

@AaronRobinsonMSFT Would it be possible to get a short description on why the team thinks the following two rules are not worth being implemented?
dotnet/roslyn-analyzers#395
dotnet/roslyn-analyzers#530

@Evangelink
Copy link
Member Author

@stephentoub @GrabYourPitchforks Could you please confirm that's ok to close all the tickets about serialization?

The tickets in the Other section are still waiting for review/decision.

@AaronRobinsonMSFT
Copy link
Member

AaronRobinsonMSFT commented Jan 7, 2022

@Evangelink Sure. Would you like the comments here or in the specific issues?

@Evangelink
Copy link
Member Author

Maybe directly on the tickets but I am fine here too. The two rules seem to make sense to me (like if you own native or disposable resources you must be disposable, and for the 2nd what's the point of using an interop if the fwk allows for the same fnctionality).

@AaronRobinsonMSFT
Copy link
Member

@Evangelink I've commented on each issue directly.

@stephentoub
Copy link
Member

@stephentoub @GrabYourPitchforks Could you please confirm that's ok to close all the tickets about serialization?

Yes, go ahead. Thanks.

@jeffhandley jeffhandley changed the title [API Proposal]: Review FxCop rules remaining to port Port remaining FxCop rules into .NET as Roslyn Analyzers Jan 22, 2022
@jeffhandley jeffhandley added Epic Groups multiple user stories. Can be grouped under a theme. and removed untriaged New issue has not been triaged by the area owner labels Jan 22, 2022
@jeffhandley jeffhandley added this to the 7.0.0 milestone Jan 22, 2022
@jeffhandley
Copy link
Member

@buyaa-n & @carlossanlop Please review the analyzers in the 'Other' category to determine if we want to bring those for API Review and include them in our plans. Thanks!

@jeffhandley
Copy link
Member

that's ok to close all the tickets about serialization

Done

@jeffhandley
Copy link
Member

We were not able to finish this list. Changing the milestone to Future to keep the epic alive. More of these analyzers will be considered as part of .NET 8 planning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Meta code-analyzer Marks an issue that suggests a Roslyn analyzer Epic Groups multiple user stories. Can be grouped under a theme. Priority:3 Work that is nice to have Team:Libraries
Projects
None yet
Development

No branches or pull requests