-
Notifications
You must be signed in to change notification settings - Fork 60
[Java.Interop] Replace Gendarme with Roslyn FxCop Analyzers. #523
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# This files sets all rules from Gendarme as Code Analysis errors | ||
# via: https://github.com/spouliot/gendarme/wiki/GendarmeToFxCop(git) | ||
|
||
[*.cs] | ||
dotnet_diagnostic.CA2001.severity = error | ||
dotnet_diagnostic.CA2214.severity = error | ||
dotnet_diagnostic.CA2222.severity = error | ||
dotnet_diagnostic.CA1065.severity = error | ||
dotnet_diagnostic.CA1041.severity = error | ||
dotnet_diagnostic.CA2230.severity = error | ||
dotnet_diagnostic.CA2006.severity = error | ||
dotnet_diagnostic.CA2002.severity = error | ||
dotnet_diagnostic.CA2211.severity = error | ||
dotnet_diagnostic.CA2243.severity = error | ||
dotnet_diagnostic.CA1053.severity = error | ||
# dotnet_diagnostic.CA1062.severity = error CheckParametersNullityInVisibleMethodsRule - We'll use NRT instead | ||
dotnet_diagnostic.CA2213.severity = error | ||
dotnet_diagnostic.CA2242.severity = error | ||
dotnet_diagnostic.CA2000.severity = error | ||
dotnet_diagnostic.CA2220.severity = error | ||
dotnet_diagnostic.CA1822.severity = error | ||
dotnet_diagnostic.CA2241.severity = error | ||
dotnet_diagnostic.CA1012.severity = error | ||
dotnet_diagnostic.CA1019.severity = error | ||
dotnet_diagnostic.CA1040.severity = error | ||
dotnet_diagnostic.CA1023.severity = error | ||
dotnet_diagnostic.CA1044.severity = error | ||
dotnet_diagnostic.CA1021.severity = error | ||
dotnet_diagnostic.CA1045.severity = error | ||
dotnet_diagnostic.CA1020.severity = error | ||
dotnet_diagnostic.CA1051.severity = error | ||
dotnet_diagnostic.CA1034.severity = error | ||
dotnet_diagnostic.CA1024.severity = error | ||
dotnet_diagnostic.CA1052.severity = error | ||
dotnet_diagnostic.CA1009.severity = error | ||
dotnet_diagnostic.CA2216.severity = error | ||
dotnet_diagnostic.CA1047.severity = error | ||
dotnet_diagnostic.CA2227.severity = error | ||
dotnet_diagnostic.CA1048.severity = error | ||
dotnet_diagnostic.CA2226.severity = error | ||
dotnet_diagnostic.CA1038.severity = error | ||
dotnet_diagnostic.CA1008.severity = error | ||
dotnet_diagnostic.CA1028.severity = error | ||
dotnet_diagnostic.CA2221.severity = error | ||
dotnet_diagnostic.CA2218.severity = error | ||
dotnet_diagnostic.CA1036.severity = error | ||
dotnet_diagnostic.CA1039.severity = error | ||
dotnet_diagnostic.CA1016.severity = error | ||
dotnet_diagnostic.CA1014.severity = error | ||
dotnet_diagnostic.CA1017.severity = error | ||
dotnet_diagnostic.CA1018.severity = error | ||
dotnet_diagnostic.CA1013.severity = error | ||
dotnet_diagnostic.CA2231.severity = error | ||
dotnet_diagnostic.CA2224.severity = error | ||
dotnet_diagnostic.CA1030.severity = error | ||
dotnet_diagnostic.CA1043.severity = error | ||
dotnet_diagnostic.CA1054.severity = error | ||
dotnet_diagnostic.CA1055.severity = error | ||
dotnet_diagnostic.CA1056.severity = error | ||
dotnet_diagnostic.CA1059.severity = error | ||
dotnet_diagnostic.CA2225.severity = error | ||
dotnet_diagnostic.CA1035.severity = error | ||
dotnet_diagnostic.CA1050.severity = error | ||
dotnet_diagnostic.CA1001.severity = error | ||
dotnet_diagnostic.CA1049.severity = error | ||
dotnet_diagnostic.CA1027.severity = error | ||
dotnet_diagnostic.CA1005.severity = error | ||
dotnet_diagnostic.CA1004.severity = error | ||
dotnet_diagnostic.CA1000.severity = error | ||
dotnet_diagnostic.CA1002.severity = error | ||
dotnet_diagnostic.CA1006.severity = error | ||
dotnet_diagnostic.CA1010.severity = error | ||
dotnet_diagnostic.CA1007.severity = error | ||
dotnet_diagnostic.CA1003.severity = error | ||
dotnet_diagnostic.CA2201.severity = error | ||
dotnet_diagnostic.CA2200.severity = error | ||
dotnet_diagnostic.CA1031.severity = error | ||
dotnet_diagnostic.CA2219.severity = error | ||
dotnet_diagnostic.CA1065.severity = error | ||
dotnet_diagnostic.CA2201.severity = error | ||
dotnet_diagnostic.CA1064.severity = error | ||
dotnet_diagnostic.CA2208.severity = error | ||
dotnet_diagnostic.CA1032.severity = error | ||
dotnet_diagnostic.CA1060.severity = error | ||
dotnet_diagnostic.CA1404.severity = error | ||
dotnet_diagnostic.CA1414.severity = error | ||
dotnet_diagnostic.CA2101.severity = error | ||
dotnet_diagnostic.CA1401.severity = error | ||
dotnet_diagnostic.CA2205.severity = error | ||
dotnet_diagnostic.CA1403.severity = error | ||
dotnet_diagnostic.CA1406.severity = error | ||
dotnet_diagnostic.CA1413.severity = error | ||
dotnet_diagnostic.CA1402.severity = error | ||
dotnet_diagnostic.CA1407.severity = error | ||
dotnet_diagnostic.CA1405.severity = error | ||
dotnet_diagnostic.CA1409.severity = error | ||
dotnet_diagnostic.CA1408.severity = error | ||
dotnet_diagnostic.CA1412.severity = error | ||
dotnet_diagnostic.CA1410.severity = error | ||
dotnet_diagnostic.CA1411.severity = error | ||
dotnet_diagnostic.CA1502.severity = error | ||
dotnet_diagnostic.CA1501.severity = error | ||
dotnet_diagnostic.CA1011.severity = error | ||
dotnet_diagnostic.CA1504.severity = error | ||
dotnet_diagnostic.CA1500.severity = error | ||
dotnet_diagnostic.CA1707.severity = error | ||
dotnet_diagnostic.CA1724.severity = error | ||
dotnet_diagnostic.CA1713.severity = error | ||
dotnet_diagnostic.CA1712.severity = error | ||
dotnet_diagnostic.CA1700.severity = error | ||
dotnet_diagnostic.CA1725.severity = error | ||
dotnet_diagnostic.CA1709.severity = error | ||
dotnet_diagnostic.CA1715.severity = error | ||
dotnet_diagnostic.CA1722.severity = error | ||
dotnet_diagnostic.CA1710.severity = error | ||
dotnet_diagnostic.CA1711.severity = error | ||
dotnet_diagnostic.CA1714.severity = error | ||
dotnet_diagnostic.CA1726.severity = error | ||
dotnet_diagnostic.CA1809.severity = error | ||
dotnet_diagnostic.CA1800.severity = error | ||
dotnet_diagnostic.CA1819.severity = error | ||
dotnet_diagnostic.CA1811.severity = error | ||
dotnet_diagnostic.CA1812.severity = error | ||
dotnet_diagnostic.CA1805.severity = error | ||
dotnet_diagnostic.CA1813.severity = error | ||
dotnet_diagnostic.CA1801.severity = error | ||
dotnet_diagnostic.CA1823.severity = error | ||
dotnet_diagnostic.CA1820.severity = error | ||
dotnet_diagnostic.CA1806.severity = error | ||
dotnet_diagnostic.CA1815.severity = error | ||
dotnet_diagnostic.CA1802.severity = error | ||
dotnet_diagnostic.CA1821.severity = error | ||
dotnet_diagnostic.CA1804.severity = error | ||
dotnet_diagnostic.CA2105.severity = error | ||
dotnet_diagnostic.CA2111.severity = error | ||
dotnet_diagnostic.CA2121.severity = error | ||
dotnet_diagnostic.CA2126.severity = error | ||
dotnet_diagnostic.CA2112.severity = error | ||
dotnet_diagnostic.CA2122.severity = error | ||
dotnet_diagnostic.CA2114.severity = error | ||
dotnet_diagnostic.CA2118.severity = error | ||
dotnet_diagnostic.CA2236.severity = error | ||
dotnet_diagnostic.CA2239.severity = error | ||
dotnet_diagnostic.CA2240.severity = error | ||
dotnet_diagnostic.CA2235.severity = error | ||
dotnet_diagnostic.CA2237.severity = error | ||
dotnet_diagnostic.CA2229.severity = error | ||
dotnet_diagnostic.CA2238.severity = error | ||
dotnet_diagnostic.CA2232.severity = error | ||
|
||
# Disable some default Code Analysis warnings we aren't interested in | ||
dotnet_diagnostic.CA1033.severity = none # Interface methods should be callable by child types | ||
dotnet_diagnostic.CA1062.severity = none # Validate arguments of public methods (we'll use nullable reference types instead) | ||
dotnet_diagnostic.CA1063.severity = none # Implement IDisposable correctly | ||
dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters | ||
dotnet_diagnostic.CA1305.severity = none # Specify IFormatProvider | ||
dotnet_diagnostic.CA1810.severity = none # Initialize reference type static fields inline | ||
dotnet_diagnostic.CA1816.severity = none # Call GC.SuppressFinalize correctly |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the "nature" of this file? What causes errors to be generated? Any build, meaning we'd see future failures in PR builds? Or just builds within "some supported IDE"?
When an error is found, how is it reported?
What's the workflow?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are understood by
msbuild
and are passed tocsc.exe
which actually does the source code analysis at compile time (this is source code analysis, not binary analysis like Gendarme or FxCop):They are reported by the compiler just like any other compiler generated warning or error, so this will now fail builds from the
msbuild
command line, in IDEs, and in CI/PR builds without any additional steps.Example:
https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3261455&view=results
If we want to ignore an instance, that goes in the suppression file. VS has a tooltip of "Suppress this error in suppression file" to do it for you, other editors may need to do it by hand, but the syntax is pretty similar to the Gendarme syntax.