Commit Graph

2284 Commits

Author SHA1 Message Date
Sergio Pedri 6ee8d7cff7 Update code style to follow repo conventions 2023-01-23 00:49:14 +01:00
Sergio Pedri b908b3fffd Define [IVT] in .props file, don't hardcode public key 2023-01-23 00:22:42 +01:00
Fredric Silberberg 78d37ab700 Use specific reference assemblies to resolve test errors, mark fixer shared. 2023-01-22 15:11:53 -08:00
Sergio Pedri b7f121c2ef Update unit tests for the two new analyzers 2023-01-22 21:34:37 +01:00
Sergio Pedri 1b02376532 Add InvalidClassLevelNotifyDataErrorInfoAttributeAnalyzer 2023-01-22 21:30:39 +01:00
Sergio Pedri 7c9958cb85 Add InvalidTypeForNotifyPropertyChangedRecipientsError 2023-01-22 21:28:43 +01:00
Fredric Silberberg 441abbbdbc Add fixers project and implement a fixer for FieldReferenceForObservablePropertyFieldAnalyzer
This adds a fixer for MVVMTK0034, that simply swaps the field reference for what will be generated for the property. It leaves the qualification intact, basically just doing a text swap. Because it's very a very simple fixer, the built-in batch fixall provider works just fine and does not need special handling.

While I implemented the fixer and added some tests, I did not actually set up all the msbuild goop for properly packaging this as part of the existing packages (as, frankly, the multi-targeting and msbuild setup in this repo is very complicated and I didn't feel like trying to grok exactly how to add it given the setup). The fixer assembly needs to be put next to the analyzer assemblies. This PR will be editable by maintainers, so feel free to implement this in-place in the PR itself.

Fixes https://github.com/CommunityToolkit/dotnet/issues/577.
2023-01-21 23:16:11 -08:00
Sergio Pedri 302b8a9d5e Merge pull request #564 from CommunityToolkit/dev/property-attribute-diagnostic
Emit diagnostic for unresolved property: attribute over [ObservableProperty] field
2023-01-16 07:18:41 -08:00
Sergio Pedri 9eb3a05d85 Add unit tests for new attribute diagnostics 2023-01-16 13:21:39 +01:00
Sergio Pedri 88ef4913d2 Add diagnostic for invalid property targeted attributes 2023-01-16 13:13:41 +01:00
Sergio Pedri 3f38be0dcb Remove unnecessary table from readme file 2023-01-15 19:30:00 +01:00
Sergio Pedri 359e0ab709 Merge pull request #562 from CommunityToolkit/dev/analyzer-diagnostics-fixes
Fix diagnostic analyzer documentation/title
2023-01-15 07:43:32 -08:00
Sergio Pedri 03af505b99 Fix MVVMTK0034 diagnostic title 2023-01-15 16:26:52 +01:00
Sergio Pedri 257ed92bd0 Move new diagnostics to 8.1 group 2023-01-15 16:25:50 +01:00
Sergio Pedri 399bf4226a Merge pull request #561 from CommunityToolkit/dev/strong-messenger-irecipient
Add missing StrongReferenceMessenger registration fast path
2023-01-13 13:55:02 -08:00
Sergio Pedri 92e68cf776 Add missing StrongReferenceMessenger registration fast path 2023-01-13 22:35:23 +01:00
Nirmal Guru 3ccdf2b89e Update Code of Conduct doc
Update the Code of Conduct doc to the latest revision from .NET Foundation.
The .NET Foundation's version was last updated in 2020 which was v2.0 revision.
The latest version available from the Contributor Covenant website is v2.1 revision.

#### PermaLinks

1. .NET Foundation's CoC: <https://dotnetfoundation.org/code-of-conduct>.
2. Contributor Covenant v2.0: <https://contributor-covenant.org/version/2/0/code_of_conduct>
3. Contributor Covenant v2.1: <https://contributor-covenant.org/version/2/1/code_of_conduct>
2023-01-13 13:13:35 -08:00
Sergio Pedri 40f7413d61 Merge pull request #551 from CommunityToolkit/dev/upper-camel-unit-test
Add unit test for [ObservableProperty] on _UpperCamel field
2023-01-01 16:09:11 -08:00
Sergio Pedri 8794cce676 Add unit test for [ObservableProperty] on _UpperCamel field 2023-01-01 18:34:11 +01:00
Sergio Pedri 8e06c7f378 Merge pull request #545 from CommunityToolkit/dev/bump-nuget
Update NuGet packages to latest stable releases
2022-12-24 22:10:32 +01:00
Sergio Pedri bc740416e2 Update NuGet packages to latest stable releases 2022-12-22 14:13:30 +01:00
Sergio Pedri 70bb31ce2f Bump version.json to 8.1.0 2022-12-20 15:11:40 +01:00
Sergio Pedri 52f0a4f800 Merge pull request #538 from CommunityToolkit/dev/remove-nullability-attributes
Remove nullability attributes generator
2022-12-19 15:51:55 -08:00
Sergio Pedri da68b2c97a Strip nullability attributes from parameters when not available 2022-12-19 20:31:23 +01:00
Sergio Pedri 8cfd646f50 Add MetadataInfo type for transitive generator 2022-12-19 20:31:23 +01:00
Sergio Pedri 6b253beeef Also generate [DebuggerNonUserCode] in transitive members 2022-12-19 20:31:23 +01:00
Sergio Pedri 5802e2f90b Stop generating polyfills for nullability attributes 2022-12-19 20:31:23 +01:00
Sergio Pedri 2a47127583 Merge pull request #541 from CommunityToolkit/dev/multi-target-legacy-support
Add target to fix analyzers on legacy .csproj projects
2022-12-19 11:30:43 -08:00
Sergio Pedri 6cf0dc0aca Add target to fix analyzers on legacy .csproj projects 2022-12-17 16:58:59 +01:00
Sergio Pedri 333265f618 Merge pull request #539 from CommunityToolkit/dev/skip-diagnostics-within-constructors
Skip field reference diagnostics from constructors
2022-12-14 08:15:57 -08:00
Sergio Pedri 1953935bbb Skip field reference diagnostics from constructors 2022-12-14 16:52:19 +01:00
Sergio Pedri 98aff983d0 Merge pull request #535 from CommunityToolkit/dev/stream-read-exactly
Use Stream.ReadExactly on .NET 7
2022-12-13 08:01:48 -08:00
Sergio Pedri cf451e8ac2 Fix exception type from Stream.Read extension 2022-12-13 16:22:22 +01:00
Sergio Pedri 5f70ec2ea7 Use Stream.ReadExactly on .NET 7 2022-12-13 13:04:21 +01:00
Sergio Pedri 460038207c Merge pull request #532 from CommunityToolkit/dev/observable-property-field-reference-analyzer
Add analyzer for references to fields with [ObservableProperty]
2022-12-13 03:56:19 -08:00
Sergio Pedri 9c35dc061a Fix formatting in field reference diagnostic message 2022-12-12 21:43:28 +01:00
Sergio Pedri 35e358459b Add unit tests for new analyzer 2022-12-12 21:35:56 +01:00
Sergio Pedri 526ed1d6da Suppress warnings from analyzers in unit tests 2022-12-12 21:35:56 +01:00
Sergio Pedri 97eb898370 Add FieldReferenceForObservablePropertyFieldAnalyzer 2022-12-12 21:35:56 +01:00
Sergio Pedri aa4ff300c4 Merge pull request #531 from CommunityToolkit/dev/base-attribute-analyzer
Add analyzer for incorrect [INotifyPropertyChanged] and [ObservableObject] use
2022-12-12 12:35:08 -08:00
Sergio Pedri e3980a73f3 Add unit tests for new analyzer 2022-12-12 20:16:33 +01:00
Sergio Pedri 88a56f493f Suppress warnings from analyzers in unit tests 2022-12-12 20:16:33 +01:00
Sergio Pedri 522d2d5b8d Add ClassUsingAttributeInsteadOfInheritanceAnalyzer 2022-12-12 20:16:32 +01:00
Sergio Pedri a7cfaa23ad Merge pull request #519 from CommunityToolkit/dev/ref-fields-memory
Use ref fields on .NET 7 for all span-like types
2022-12-12 07:06:40 -08:00
Sergio Pedri 839fd647c1 Merge pull request #520 from CommunityToolkit/dev/fix-stream-read-of-t
Fix StreamExtensions.Read<T> when using buffered streams
2022-12-07 15:01:34 -08:00
Sergio Pedri 7eef9f293e Add unit tests for buffered StreamExtensions.Read<T> 2022-12-07 16:57:22 +01:00
Sergio Pedri fe6362b88b Optimize StreamExtensions.Read<T> downlevel 2022-12-07 16:57:09 +01:00
Sergio Pedri debbb0513f Fix StreamExtensions.Read<T> for buffered streams 2022-12-07 16:13:47 +01:00
Sergio Pedri 47b8fe44ea Use ref fields in [ReadOnly]RefEnumerable<T>-s 2022-12-07 13:45:16 +01:00
Sergio Pedri 434f4825d3 Use ref fields in [ReadOnly]SpanEnumerable<T>-s 2022-12-07 13:20:54 +01:00