Age | Commit message (Collapse) | Author |
|
* Warn on usage of attributes with annotated ctors
* PR feedback
Add ProducedBy from Test Restructure
Add support for SetupCompileBefore in the analyzer
Run analyzer tests on all members (not only methods)
Move tests to RequiresCapability
* Enable analyzer tests for attributes which use RUC annotated properties
* Lint
* Rename CheckAttributeCtor
Check for instantiations that set annotated properties
* Apply suggestions from code review
Co-authored-by: Andy Gocke <angocke@microsoft.com>
* Update comment
Rename Linker => Trimmer in ProducedBy
* Fix applied suggestions
* Lint
Co-authored-by: Andy Gocke <angocke@microsoft.com>
|
|
* Add MakeGenericMethod and MakeGenericType to the special incompatible members of the RUC analyzer.
* Don't produce diagnostics for MakeGenericMethod/MakeGenericType
* Add comment
* Lint
|
|
* PR feedback
* Remove unnecessary method
|
|
Add new error code for cases in which the static constructor is
annotated with RUC
Add IL2116 to error codes
Move static constructor verification in MarkField before pushing a new
stack to print warnings in the method caller instead of fields
Don't treat static constructors annotated with RUC as dangerous
Add test for several static constructor calls
Warn on field instead of warning on .cctor
* Field should warn no matter the DependencyKind except
DynamicallyAccessedMemberOnType
* Add test for Access to field via reflection, dynamic dependency and
using fields on attributes
Co-authored-by: vitek-karas <vitek.karas@microsoft.com>
|
|
|
|
* Use DiagnosticId
* Update test/ILLink.RoslynAnalyzer.Tests/RequiresUnreferencedCodeAnalyzerTests.cs
Co-authored-by: Andy Gocke <angocke@microsoft.com>
* Lint
Co-authored-by: Andy Gocke <angocke@microsoft.com>
|
|
given a DiagnosticId (#2170)
* Add DiagnosticId enum
Add GetDiagnosticDescriptor
* Check that the diagnostic id is in the range of the supported linker warnings
* Lint
* Share DiagnosticString
* Noisy whitespace
* Warnings go up to 6000 inclusive
* PR feedback
* Get diagnostic string
Update test
* Lint
* PR feedback
|
|
Bump sdk version in global.json
Fix new analyzer recommendations about AsSpan and Contains(char)
Disable ImplicitNamespaceImports
Update Microsoft.NetCore.App.Ref used by analyzer to take new Runtime attribute changes
Update analyzer to not use Message as a property in RequiresAssemblyFilesAttribute
Update cecil to use Microsoft.NETFramework.ReferenceAssemblies.net40 1.0.2 along with taking other cecil updates
|
|
The version is currently hardcoded in TestCaseUtils.cs, but since
these are reference assemblies, as long as the surface area isn't
predicted to change, we can update as necessary.
|
|
Adds several new tests for various RUC scenarios.
Cleans up the RUC tests to correctly baseline all warnings it produces.
Fixes a product issue with RUC on attribute property setter.
Small refactoring in the product.
|
|
Add analyzer logic to create a diagnostic if attributes don't match between all interface implementations or overrides
Use IL2046 to display errors for RUC
Use IL3003 to display errors for RAF
Add IL3003 to error-codes.md
Add tests
Adds support for nullable attribute operations
Add support for adding metadata information into the compilation
Divide the current warning message into 4 different more insightful diagnostic messages following the structure implemented in ObsoleteAttribute messages
Add IL2046 to diagnostic format to ILLink.Shared
|
|
* Don't duplicate trailing periods on IL2026 warning message
* Do the same for RAF
* Run lint.cmd
|
|
(#2048)
* Refactor TestCaseUtils
* Whitespace
|
|
Probably due to copy/paste error we've validated the attribute by looking at all warning messages at once. This means that potentially any warning can be matched to the attribute even if its location doesn't match.
This change fixes that but uncovers some small test issues:
* The expected warnings happen in different places - fixed that
* Some warnings can't be reported by the Roslyn Analyzer as they require global view - added a mechanism to mark these
Refactored a bit of the Roslyn analyzer validation code to support named properties in attributes.
|
|
Stops looking for the first file in the `RequiresCapability` directory and instead looks at all the files.
|
|
Add RequiresAssemblyFiles CodeFix
Add tests
Fix #2005
Refactor analyzer code. Fixes #1986
Add resources files to codefixer
|
|
Add CodeFix for UnconditionalSuppressMessage
Add test for UnconditionalSuppressMessage
Change FindContainingMember to FindAttributableParent and add a list of AttributableParentTargets to values that are possible
Add a base class to remove code duplication
Use net5.0 reference assemblies and define requiresAssemblyFiles manually (reverts #1922)
|
|
Fix delegate conversion on analyzers
Fix test in RequiresUnreferencedCodeAnalyzer
Add tests for delegate conversion
Add the ability to pass the number of iterations in a codefix
|
|
Bundles both the analyzer and codefix together as analyzers.
|
|
capability to suppress IL3000/IL3001 with RequiresAssemblyFilesAnalyzer (#1921)
Merge SingleFileAnalyzer into RequiresAssemblyFilesAnalyzer
Suppress warnings on dangerous patterns if RequiresAssemblyFilesAttribute is used on the parent call
Fix case in which we have a dangerous method inside a property
Add tests
|
|
Simple codefix that just adds RequiresUnreferencedCode to the containing
method if a RequiresUnreferencedCode analyzer warning fires.
|
|
* Used repo's dotnet bits
* Remove unused assembly
* Just reference SPCL
* Simplify
* Remove using
|
|
[main] Update dependencies from dotnet/runtime
- Disable unreliable test
|
|
Add support in analyzer to detect RUC in overridden methods
Add support in analyzer to detect RUC in static constructors
Add test for overridden property
|
|
* Cctor marked because of accessed field should trigger warning
* Ignore testcase in analyzer
* Add tests
Move field initialization to cctor
* Add beforefieldinit test to list of tests ignored by the analyzer
* Fix testname
|
|
|
|
Change PublishSingleFile and PublishTrimmed for EnableSingleFileAnalyzer and
EnableTrimAnalyzer in the linker
|
|
|
|
|
|
* Change resource file to have a default message and accept arguments
* Add test for RequiresAssemblyFilesAttribute with Url named argument only
* Add IL3XXX warning codes to the master error code registry
* Throw whenever a named argument is passed in ExpectedWarning
|
|
* Only process direct calls and reflection method references.
* Clean test
* Add tests
* Check for null origin
* Warn on DynamicallyAccessedMember kind.
* Update warnings message for Requires Unreferenced Code
* Mark interfaces of types accessed via reflection
* Fix whitespace
* Add includeInterfaceTypes parameter
* Keep set action for methods in MarkEntireType
* Add test for dynamic dependency with RUC.
* Fix DependencyKind in MarkTypeForDynamicallyAccessedMembers
Pass null to origin's parameter when processing optimized overrides
Add DynamicDependency to list of valid dependency kinds in ProcessRequiresUnreferencedCode
* Fix formatting
|
|
|
|
|
|
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
|
|
-Check parent to see if it has any UnreferencedCodeAttribute
-Since allowMultiple is disabled by default, only check the attributes until first UnreferencedCodeAttribute is found
|
|
* Add single-file analyzer
* Add tests
* Use str constant
* Update Resources
* Update tests
* PR feedback
* Remove mysterious filename from comments
* Add helper method for single-file diagnostic verification
* Refactor MSBuild properties
* Add test with PublishSingleFile not set
|
|
* Add supported diagnostics for when we use Url named argument
* Add support for Expected Warning
* Use single format for Resource file
* Dont execute test that used another diagnostic id that is not 2026
* Change formats in the linker for setters and getters to match C# format
* Use GetSignature in method instead of ToString()
|
|
This analyzer approximates the warnings produced by the linker around
the RequiresUnreferencedCodeAttribute.
|