Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson committed Jun 18, 2021
2 parents 427ac63 + 7c734a5 commit fba454b
Show file tree
Hide file tree
Showing 209 changed files with 3,916 additions and 2,684 deletions.
42 changes: 24 additions & 18 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ root = true
insert_final_newline = true
indent_style = space
indent_size = 4

[project.json]
indent_size = 2
trim_trailing_whitespace = true

# C# files
[*.cs]

# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
Expand All @@ -42,15 +41,10 @@ dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# only use var when it's obvious what the variable type is
csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Types: use keywords instead of BCL types, and permit var only when the type is clear
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:none
csharp_style_var_elsewhere = false:suggestion
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:none
csharp_style_var_elsewhere = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

Expand All @@ -62,14 +56,14 @@ dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# static fields should have s_ prefix
# static fields should have _ prefix
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
dotnet_naming_style.static_prefix_style.required_prefix = s_
dotnet_naming_style.static_prefix_style.required_prefix = _
dotnet_naming_style.static_prefix_style.capitalization = camel_case

# internal and private fields should be _camelCase
Expand All @@ -84,7 +78,7 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
# Code style defaults
csharp_using_directive_placement = outside_namespace:suggestion
dotnet_sort_system_directives_first = true
csharp_prefer_braces = true:silent
csharp_prefer_braces = true:suggestion
csharp_preserve_single_line_blocks = true:none
csharp_preserve_single_line_statements = false:none
csharp_prefer_static_local_function = true:suggestion
Expand All @@ -105,8 +99,8 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggesti
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion

# Expression-bodied members
Expand Down Expand Up @@ -248,6 +242,7 @@ dotnet_diagnostic.RCS1074.severity = error
dotnet_diagnostic.RCS1090.severity = error
dotnet_diagnostic.RCS1138.severity = error
dotnet_diagnostic.RCS1139.severity = error
dotnet_diagnostic.RCS1158.severity = none
dotnet_diagnostic.RCS1163.severity = suggestion
dotnet_diagnostic.RCS1168.severity = suggestion
dotnet_diagnostic.RCS1188.severity = error
Expand Down Expand Up @@ -430,15 +425,21 @@ dotnet_diagnostic.SX1101.severity = error
dotnet_diagnostic.SX1309.severity = error
dotnet_diagnostic.SX1623.severity = none

dotnet_diagnostic.IDE0046.severity = suggestion
dotnet_diagnostic.IDE0060.severity = none

# C++ Files
[*.{cpp,h,in}]
curly_bracket_next_line = true
indent_brace_style = Allman

# Xml project files
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2

[*.{csproj,vbproj,proj,nativeproj,locproj}]
charset = utf-8

# Xml build files
[*.builds]
indent_size = 2
Expand All @@ -451,8 +452,13 @@ indent_size = 2
[*.{props,targets,config,nuspec}]
indent_size = 2

# YAML config files
[*.{yml,yaml}]
indent_size = 2

# Shell scripts
[*.sh]
end_of_line = lf
[*.{cmd, bat}]

[*.{cmd,bat}]
end_of_line = crlf
2 changes: 1 addition & 1 deletion integrationtests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.321" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="3.1.0" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="3.2.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)..\src\stylecop.json" Link="stylecop.json" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.483" />
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.514" />
<PackageReference Include="ReactiveUI.AndroidSupport" Version="*" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.*" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.*" />
Expand All @@ -62,7 +62,7 @@
<PackageReference Include="Xamarin.Android.Support.Compat" Version="28.0.*" />
<PackageReference Include="Xamarin.Android.Support.Collections" Version="28.0.*" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.*" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.2.1" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.3" />
<PackageReference Include="Xamarin.AndroidX.Preference" Version="1.1.1.8" />
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.7" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Acr.UserDialogs">
<Version>7.1.0.483</Version>
<Version>7.1.0.514</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.*" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.483" />
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.514" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IntegrationTests.XamarinForms\IntegrationTests.XamarinForms.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.483" />
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.514" />
<PackageReference Include="ReactiveUI.XamForms" Version="*" />
<PackageReference Include="Xamarin.Forms" Version="4.8.*" />
<PackageReference Include="Xamarin.Forms" Version="5.0.*" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
</PropertyGroup>

<ItemGroup Condition="$(IsTestProject)">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Xunit.StaFact" Version="1.0.37" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="5.0.0" />
<PackageReference Include="PublicApiGenerator" Version="10.2.0" />
<PackageReference Include="DiffEngine" Version="6.6.1" />
<PackageReference Include="DiffEngine" Version="6.8.2" />
<PackageReference Include="coverlet.msbuild" Version="3.0.3" PrivateAssets="All" />
</ItemGroup>

Expand All @@ -59,13 +59,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.190" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.216" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.321" PrivateAssets="all" />
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.333" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="3.1.0" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="3.2.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
Expand Down
6 changes: 3 additions & 3 deletions src/ReactiveUI.AndroidX/ReactiveUI.AndroidX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

<ItemGroup>
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.7" />
<PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.3.2" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.0" />
<PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.3.4" />
<PackageReference Include="Xamarin.AndroidX.Preference" Version="1.1.1.8" />
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.1.0.8" />
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.2.1" />
<Reference Include="System.Runtime.Serialization" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net5')) ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Splat.Drawing" Version="10.*" />
<PackageReference Include="Splat.Drawing" Version="11.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.*" />
<PackageReference Include="Xamarin.Forms" Version="5.0.*" />
<PackageReference Include="Pharmacist.MsBuild" Version="2.*" PrivateAssets="all" />
<PackageReference Include="Pharmacist.Common" Version="2.*" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ private static IEnumerable<Diagnostic> GetNewDiagnostics(IEnumerable<Diagnostic>
var oldArray = diagnostics.OrderBy(d => d.Location.SourceSpan.Start).ToArray();
var newArray = newDiagnostics.OrderBy(d => d.Location.SourceSpan.Start).ToArray();

int oldIndex = 0;
int newIndex = 0;
var oldIndex = 0;
var newIndex = 0;

while (newIndex < newArray.Length)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public IList<DiagnosticResultLocation> Locations
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = 1054991603;
var hashCode = 1054991603;
hashCode = (hashCode * -1521134295) + EqualityComparer<IList<DiagnosticResultLocation>>.Default.GetHashCode(_locations);
hashCode = (hashCode * -1521134295) + EqualityComparer<IList<DiagnosticResultLocation>>.Default.GetHashCode(Locations);
hashCode = (hashCode * -1521134295) + Severity.GetHashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ private static Document[] GetDocuments(string[] sources, string language)
/// <returns>A Project created out of the Documents created from the source strings.</returns>
private static Project? CreateProject(string[] sources, string language = LanguageNames.CSharp)
{
string fileNamePrefix = DefaultFilePathPrefix;
string fileExt = language == LanguageNames.CSharp ? CSharpDefaultFileExt : VisualBasicDefaultExt;
var fileNamePrefix = DefaultFilePathPrefix;
var fileExt = language == LanguageNames.CSharp ? CSharpDefaultFileExt : VisualBasicDefaultExt;

var projectId = ProjectId.CreateNewId(debugName: TestProjectName);

Expand All @@ -163,7 +163,7 @@ private static Document[] GetDocuments(string[] sources, string language)
.AddMetadataReference(projectId, ReactiveUi)
.AddMetadataReference(projectId, ReactiveUiHelper);

int count = 0;
var count = 0;
foreach (var source in sources)
{
var newFileName = fileNamePrefix + count + "." + fileExt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ public abstract partial class DiagnosticVerifier
/// <param name="expectedResults">Diagnostic Results that should have appeared in the code.</param>
private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults)
{
int expectedCount = expectedResults.Length;
var expectedCount = expectedResults.Length;
var actualCountList = actualResults.ToList();
int actualCount = actualCountList.Count;
var actualCount = actualCountList.Count;

if (expectedCount != actualCount)
{
string diagnosticsOutput = actualCountList.Any() ? FormatDiagnostics(analyzer, actualCountList.ToArray()) : " NONE.";
var diagnosticsOutput = actualCountList.Any() ? FormatDiagnostics(analyzer, actualCountList.ToArray()) : " NONE.";

Assert.True(
false,
$"Mismatch between number of diagnostics returned, expected \"{expectedCount}\" actual \"{actualCount}\"\r\n\r\nDiagnostics:\r\n{diagnosticsOutput}\r\n");
}

for (int i = 0; i < expectedResults.Length; i++)
for (var i = 0; i < expectedResults.Length; i++)
{
var actual = actualCountList[i];
var expected = expectedResults[i];
Expand All @@ -113,7 +113,7 @@ private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResult
$"Expected {expected.Locations.Count - 1} additional locations but got {additionalLocations.Length} for Diagnostic:\r\n {FormatDiagnostics(analyzer, actual)}\r\n");
}

for (int j = 0; j < additionalLocations.Length; ++j)
for (var j = 0; j < additionalLocations.Length; ++j)
{
VerifyDiagnosticLocation(analyzer, actual, additionalLocations[j], expected.Locations[j + 1]);
}
Expand Down Expand Up @@ -192,7 +192,7 @@ private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagno
private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics)
{
var builder = new StringBuilder();
for (int i = 0; i < diagnostics.Length; ++i)
for (var i = 0; i < diagnostics.Length; ++i)
{
builder.AppendLine("// " + diagnostics[i].ToString());

Expand All @@ -214,7 +214,7 @@ private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diag
location.IsInSource,
$"Test base does not currently handle diagnostics in metadata locations. Diagnostic in metadata: {diagnostics[i]}\r\n");

string resultMethodName = diagnostics[i].Location.SourceTree!.FilePath.EndsWith(".cs", StringComparison.Ordinal) ? "GetCSharpResultAt" : "GetBasicResultAt";
var resultMethodName = diagnostics[i].Location.SourceTree!.FilePath.EndsWith(".cs", StringComparison.Ordinal) ? "GetCSharpResultAt" : "GetBasicResultAt";
var linePosition = diagnostics[i].Location.GetLineSpan().StartLinePosition;

builder.Append($"{resultMethodName}({linePosition.Line + 1}, {linePosition.Character + 1}, {analyzerType.Name}.{rule.Id})");
Expand Down
3 changes: 3 additions & 0 deletions src/ReactiveUI.Fody.Analyzer/AnalyzerReleases.Shipped.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; Shipped analyzer releases
; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

8 changes: 8 additions & 0 deletions src/ReactiveUI.Fody.Analyzer/AnalyzerReleases.Unshipped.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
; Unshipped analyzer release
; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

### New Rules
Rule ID | Category | Severity | Notes
--------|----------|----------|-------
RUI_0001 | Fody | Error | ReactiveObjectAnalyzer
RUI_0002 | Fody | Error | ReactiveObjectAnalyzer

0 comments on commit fba454b

Please sign in to comment.