microsoft / axe-windows

Automated accessibility testing engine for Windows applications
MIT License
136 stars 62 forks source link

chore: Apply/suppress new analyzer suggestions #886

Closed DaveTryon closed 1 year ago

DaveTryon commented 1 year ago

Details

The latest version of Visual Studio analyzers are flagging some things that they didn't flag before. This PR represents a single pass through the project to update the appropriate fields. The commits are non-overlapping and it's possibly simplest to review on a per-commit basis.

Motivation

Make analyzer suggestions more obvious in the IDE and less dangerous (i.e., don't use suggestions that require C# versions that we aren't guaranteed to have).

Context

According to the C# language versioning docs, both .NET Standard 2.0 and .NET Framework default to C# 7.3, which is why we max out the suggestions there. The fields added to .editorconfig are based on the actual analyzer messages that occurred. I made no attempt to create an exhaustive list (potentially based on https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?tabs=net-7), since it would quickly get out of date and it's easy to check new analyzer suggests as they occur.

The .editorconfig changes should probably also occur in AIWin, but that's far from urgent...

Pull request checklist