diff --git a/docs/Rules/MA0001.md b/docs/Rules/MA0001.md index c39a8380..f8efb747 100644 --- a/docs/Rules/MA0001.md +++ b/docs/Rules/MA0001.md @@ -5,7 +5,7 @@ Sources: [UseStringComparisonAnalyzer.cs](https://github.com/meziantou/Meziantou String manipulation methods in .NET do not all use the same default rules for string comparison by culture and case. For instance, `string.Equals(string, string)` uses `StringComparison.Ordinal` whereas `IndexOf(String)` uses `StringComparison.CurrentCulture`. So, you should use an overload that does not rely on default behavior. -MA0001 only reports a diagnostic when the default comparison for the method is `Ordinal` or `OrdinalIgnoreCase`. [`MA0074`](./MA0074.md) reports all others cases. +MA0001 only reports a diagnostic when the default comparison for the method is `Ordinal` or `OrdinalIgnoreCase`. [`MA0074`](./MA0074.md) reports all other cases. ````csharp string.Equals("a", "b"); // non-compliant as the default comparison of string.Equals is Ordinal diff --git a/docs/Rules/MA0003.md b/docs/Rules/MA0003.md index 000d7385..17a66074 100644 --- a/docs/Rules/MA0003.md +++ b/docs/Rules/MA0003.md @@ -3,7 +3,7 @@ Sources: [NamedParameterAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/NamedParameterAnalyzer.cs), [NamedParameterFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/NamedParameterFixer.cs) -You should name the parameter when you call a method with a literal value +You should name the parameter when calling a method with a literal value: - `null` - `true` diff --git a/docs/Rules/MA0009.md b/docs/Rules/MA0009.md index 9c5f86b5..cf057476 100644 --- a/docs/Rules/MA0009.md +++ b/docs/Rules/MA0009.md @@ -17,4 +17,4 @@ private static partial Regex Test(); ```` -More information: [Regex - Deny of Service (ReDoS)](https://www.meziantou.net/regex-deny-of-service-redos.htm) +More information: [Regex - Denial of Service (ReDoS)](https://www.meziantou.net/regex-deny-of-service-redos.htm) diff --git a/docs/Rules/MA0011.md b/docs/Rules/MA0011.md index b7bca12b..44b18bf3 100644 --- a/docs/Rules/MA0011.md +++ b/docs/Rules/MA0011.md @@ -5,7 +5,7 @@ Sources: [UseIFormatProviderAnalyzer.cs](https://github.com/meziantou/Meziantou. This rule warns about the usage of overloads of methods like `Parse`, `TryParse` and `ToString` that do not take a parameter of type `IFormatProvider`. -More information on Creating Globally Aware Applications here: [Creating Globally Aware Applications](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc853414(v=vs.95)?WT.mc_id=DT-MVP-5003978) +For more information, see [Creating Globally Aware Applications](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc853414(v=vs.95)?WT.mc_id=DT-MVP-5003978). ````csharp DateTime.TryParse("", out var result); diff --git a/docs/Rules/MA0024.md b/docs/Rules/MA0024.md index 9b788a4c..286ccaea 100644 --- a/docs/Rules/MA0024.md +++ b/docs/Rules/MA0024.md @@ -3,7 +3,7 @@ Sources: [DoNotUseEqualityComparerDefaultOfStringAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzer.cs), [DoNotUseEqualityComparerDefaultOfStringFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityComparerDefaultOfStringFixer.cs) -You should use an explicit comparer for string. +You should use an explicit comparer for strings. ````csharp EqualityComparer.Default.Equals("a", "b"); diff --git a/docs/Rules/MA0029.md b/docs/Rules/MA0029.md index bac38b4f..9bd0aea5 100644 --- a/docs/Rules/MA0029.md +++ b/docs/Rules/MA0029.md @@ -3,7 +3,7 @@ Sources: [OptimizeLinqUsageAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs), [OptimizeLinqUsageFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs) -Combine LINQ methods when possible +Combine LINQ methods when possible. ```csharp new int[0].Where(x => true).Any(); diff --git a/docs/Rules/MA0031.md b/docs/Rules/MA0031.md index 038132e6..3c1135b7 100644 --- a/docs/Rules/MA0031.md +++ b/docs/Rules/MA0031.md @@ -3,7 +3,7 @@ Sources: [OptimizeLinqUsageAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs), [OptimizeLinqUsageFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs) -Replace `Count()` by a more optimized method +Replace `Count()` with a more optimized method. ```csharp enumerable.Count() > 10; diff --git a/docs/Rules/MA0038.md b/docs/Rules/MA0038.md index 68c5c400..094f36ab 100644 --- a/docs/Rules/MA0038.md +++ b/docs/Rules/MA0038.md @@ -4,7 +4,7 @@ Sources: [MakeMethodStaticAnalyzer.cs](https://github.com/meziantou/Meziantou.An > **Warning** -> This rule is deprecated and will be removed in the future. It's recommended to use use [CA1822](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822?WT.mc_id=DT-MVP-5003978) instead. +> This rule is deprecated and will be removed in the future. It is recommended to use [CA1822](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822?WT.mc_id=DT-MVP-5003978) instead. If the method only uses static or const members, you should consider making the method static. diff --git a/docs/Rules/MA0041.md b/docs/Rules/MA0041.md index fe7e2345..9cb28ef7 100644 --- a/docs/Rules/MA0041.md +++ b/docs/Rules/MA0041.md @@ -4,6 +4,6 @@ Sources: [MakeMethodStaticAnalyzer.cs](https://github.com/meziantou/Meziantou.An > **Warning** -> This rule is deprecated and will be removed in the future. It's recommended to use use [CA1822](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822?WT.mc_id=DT-MVP-5003978) instead. +> This rule is deprecated and will be removed in the future. It is recommended to use [CA1822](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822?WT.mc_id=DT-MVP-5003978) instead. If the property only uses static or const members, you should consider making the property static. diff --git a/docs/Rules/MA0042.md b/docs/Rules/MA0042.md index 318f00f1..269adc89 100644 --- a/docs/Rules/MA0042.md +++ b/docs/Rules/MA0042.md @@ -17,7 +17,7 @@ public async Task Sample() } ```` -The rule only reports a diagnostic when the enclosing method is already `async` or when the `async` keyword can be added with changing the return type. While you can use `async void`, the rule will not report a diagnostic when the method returns `void`. [MA0045](MA0045.md) detects the same cases, but reports them even if applying a fix would require you to change the calling method's signature. +The rule only reports a diagnostic when the enclosing method is already `async` or when the `async` keyword can be added without changing the return type. While you can use `async void`, the rule will not report a diagnostic when the method returns `void`. [MA0045](MA0045.md) detects the same cases, but reports them even if applying a fix would require you to change the calling method's signature. ````csharp public Task Sample() diff --git a/docs/Rules/MA0048.md b/docs/Rules/MA0048.md index 8f0e956d..ebcae994 100644 --- a/docs/Rules/MA0048.md +++ b/docs/Rules/MA0048.md @@ -3,9 +3,9 @@ Source: [FileNameMustMatchTypeNameAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/FileNameMustMatchTypeNameAnalyzer.cs) -The name of the class must match to name of the file. This rule has two main reasons: +The name of the class must match the name of the file. This rule has two main reasons: - Ensuring the type name is the same as the file name. This prevents renaming a type without renaming the file. -- When you navigate in the code without an IDE, such as GitHub, GitLab or most web interfaces, you can quickly find the file that you are insterested in. +- When you navigate code without an IDE, such as on GitHub, GitLab, or most web interfaces, you can quickly find the file that you are interested in. The diagnostic message includes the type kind and name to provide clear context: - `File name must match type name (class MyClass)` diff --git a/docs/Rules/MA0049.md b/docs/Rules/MA0049.md index 34811645..81448549 100644 --- a/docs/Rules/MA0049.md +++ b/docs/Rules/MA0049.md @@ -3,7 +3,7 @@ Source: [TypeNameMustNotMatchNamespaceAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/TypeNameMustNotMatchNamespaceAnalyzer.cs) -For usability, you should not name a type as the namespace. This would be harder to use it in the code. +For usability, you should not give a type the same name as its containing namespace, as this makes the type harder to use in code. ````csharp namespace Foo diff --git a/docs/Rules/MA0052.md b/docs/Rules/MA0052.md index 508a85ce..f500fe33 100644 --- a/docs/Rules/MA0052.md +++ b/docs/Rules/MA0052.md @@ -3,7 +3,7 @@ Sources: [ReplaceEnumToStringWithNameofAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/ReplaceEnumToStringWithNameofAnalyzer.cs), [ReplaceEnumToStringWithNameofFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/ReplaceEnumToStringWithNameofFixer.cs) -You should use `nameof` instead of calling `ToString` on a constant enumeration value. This is mainly for performance reason. +You should use `nameof` instead of calling `ToString` on a constant enumeration value. This is primarily for performance reasons. ````csharp public enum Color diff --git a/docs/Rules/MA0053.md b/docs/Rules/MA0053.md index 16b5b776..27ad542d 100644 --- a/docs/Rules/MA0053.md +++ b/docs/Rules/MA0053.md @@ -27,7 +27,7 @@ public sealed class Bar : Foo # Configuration A Roslyn analyzer can only know the current project context, not the full solution. -Therefore it cannot know if a public class or record is used in another project hereby making it possibly inaccurate to report this diagnostic for `public` types. +Therefore it cannot know if a public class or record is used in another project, which may make it inaccurate to report this diagnostic for `public` types. You can still enable this rule for `public` classes and records using the `.editorconfig`: ```` @@ -42,7 +42,7 @@ Classes and records with `virtual` members cannot be sealed. By default, these t MA0053.class_with_virtual_member_should_be_sealed = true ```` -Classes that inherits from `Exception`are not reported by default. You can enable the analyzer for these classes using the `.editorconfig`: +Classes that inherit from `Exception` are not reported by default. You can enable the analyzer for these classes using the `.editorconfig`: ```` # .editorconfig file diff --git a/docs/Rules/MA0055.md b/docs/Rules/MA0055.md index 47caaf4c..9ea7eaa8 100644 --- a/docs/Rules/MA0055.md +++ b/docs/Rules/MA0055.md @@ -3,7 +3,7 @@ Source: [DoNotUseFinalizerAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/DoNotUseFinalizerAnalyzer.cs) -Finalizers should be used to ensure native resources are released. Since .NET 2.0, you should better encapsulate the native resources into a [`System.Runtime.InteropServices.SafeHandle`](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle?WT.mc_id=DT-MVP-5003978). +Finalizers should be used to ensure native resources are released. Since .NET 2.0, you should instead encapsulate native resources in a [`System.Runtime.InteropServices.SafeHandle`](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.safehandle?WT.mc_id=DT-MVP-5003978). - [Stop using IntPtr for dealing with system handles](https://www.meziantou.net/2019/05/13/stop-using-intptr-for-dealing-with-system-handles) - [Finalizers (C# Programming Guide)](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers?WT.mc_id=DT-MVP-5003978) diff --git a/docs/Rules/MA0062.md b/docs/Rules/MA0062.md index 336a616f..643f5b66 100644 --- a/docs/Rules/MA0062.md +++ b/docs/Rules/MA0062.md @@ -18,7 +18,7 @@ public enum Color # Configuration -In the following case, `All` is not a power of 2 and not a combination of other values. However, this construct can be used to easily defined a value that contains all other flags. +In the following case, `All` is not a power of 2 and not a combination of other values. However, this construct can be used to easily define a value that contains all other flags. ```` [Flags] diff --git a/docs/Rules/MA0063.md b/docs/Rules/MA0063.md index 94acabe6..062acb83 100644 --- a/docs/Rules/MA0063.md +++ b/docs/Rules/MA0063.md @@ -3,8 +3,8 @@ Sources: [OptimizeLinqUsageAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs), [OptimizeLinqUsageFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs) -Using `Where` clause after `OrderBy` clause requires the whole collection to be sorted and then filtered. -`Where` should be called first to sort only the filtered items. +Using a `Where` clause after an `OrderBy` clause requires the entire collection to be sorted before being filtered. +`Where` should be called first so that only the filtered items are sorted. ````csharp enumerable.Where(...).OrderBy(...) // compliant diff --git a/docs/Rules/MA0074.md b/docs/Rules/MA0074.md index edc2ac42..2ce99458 100644 --- a/docs/Rules/MA0074.md +++ b/docs/Rules/MA0074.md @@ -5,7 +5,7 @@ Sources: [UseStringComparisonAnalyzer.cs](https://github.com/meziantou/Meziantou String manipulation methods in .NET do not all use the same default rules for string comparison by culture and case. For instance, `string.Equals(string, string)` uses `StringComparison.Ordinal` whereas `IndexOf(String)` uses `StringComparison.CurrentCulture`. So, you should use an overload that does not rely on default behavior. -MA0074 only reports a diagnostic when the default comparison for the method is not `Ordinal` and not `OrdinalIgnoreCase`. [`MA0001`](./MA0001.md) reports all others cases. +MA0074 only reports a diagnostic when the default comparison for the method is not `Ordinal` and not `OrdinalIgnoreCase`. [`MA0001`](./MA0001.md) reports all other cases. ````csharp "a".StartsWith("b"); // non-compliant as the default comparison of StartsWith is CurrentCulture diff --git a/docs/Rules/MA0075.md b/docs/Rules/MA0075.md index e28a4652..5cbe7ec8 100644 --- a/docs/Rules/MA0075.md +++ b/docs/Rules/MA0075.md @@ -27,7 +27,7 @@ An exception is made for the following types: * System.Windows.FontStretch * System.Windows.Media.Brush -In case of the following types, MA0075 is not reported when the operand is a positive (>= 0) constant: +For the following types, MA0075 is not reported when the operand is a non-negative (>= 0) constant: * System.Int16 * System.Int32 diff --git a/docs/Rules/MA0104.md b/docs/Rules/MA0104.md index 1ac2657a..41a42405 100644 --- a/docs/Rules/MA0104.md +++ b/docs/Rules/MA0104.md @@ -9,14 +9,14 @@ public class String // MA0104 } ```` -You can configure the types / namespaces to consider in the `.editorconfig` file +You can configure the types and namespaces to consider in the `.editorconfig` file ```` MA0104.namespaces_regex = ^System($|\.) MA0104.use_preview_types = true # use types from preview versions of .NET ```` -By default the rule only applies to public types. Add the following line to the `.editorconfig` file to consider all types: +By default, the rule only applies to public types. Add the following line to the `.editorconfig` file to consider all types: ```` MA0104.only_consider_public_symbols = false diff --git a/docs/Rules/MA0112.md b/docs/Rules/MA0112.md index 330c7c3a..571f95f7 100644 --- a/docs/Rules/MA0112.md +++ b/docs/Rules/MA0112.md @@ -3,7 +3,7 @@ Sources: [OptimizeLinqUsageAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs), [OptimizeLinqUsageFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs) -For performance reasons, use the `Count` property instead of `Any()` +For performance reasons, use the `Count` property instead of `Any()`. ````c# var collection = new int[10]; diff --git a/docs/Rules/MA0115.md b/docs/Rules/MA0115.md index a6a5c12a..1f48ae26 100644 --- a/docs/Rules/MA0115.md +++ b/docs/Rules/MA0115.md @@ -3,7 +3,7 @@ Source: [DoNotUseUnknownParameterForRazorComponentAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzer.cs) -Detect usage of invalid parameter in Razor components. +Detects invalid parameter usage in Razor components. ```razor @* SampleComponent *@ @@ -21,13 +21,13 @@ Detect usage of invalid parameter in Razor components. InvalidParameter="Dummy" /> // Report diagnostic as `InvalidParameter` does not exist in SampleComponent ``` -In the case where the component allows for unmatched parameters, you can still detect parameters that are in PascalCase. +When a component allows unmatched parameters, parameters with PascalCase names can still be detected. ```.editorconfig MA0115.ReportPascalCaseUnmatchedParameter ``` -In the following example, `Param` is reported as an unmatched parameter. +In the following example, `InvalidParameter` is reported as an unmatched parameter. ````c# class MyComponent : ComponentBase diff --git a/docs/Rules/MA0116.md b/docs/Rules/MA0116.md index 8217590e..a4d41697 100644 --- a/docs/Rules/MA0116.md +++ b/docs/Rules/MA0116.md @@ -3,7 +3,7 @@ Sources: [ParameterAttributeForRazorComponentAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/ParameterAttributeForRazorComponentAnalyzer.cs), [ParameterAttributeForRazorComponentFixer.AddParameterAttribute.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/ParameterAttributeForRazorComponentFixer.AddParameterAttribute.cs) -Detect when `[SupplyParameterFromQuery]` attributes are used without the `[Parameter]` attributes. +Detects when `[SupplyParameterFromQuery]` attributes are used without the `[Parameter]` attribute. ````razor using Microsoft.AspNetCore.Components; diff --git a/docs/Rules/MA0119.md b/docs/Rules/MA0119.md index d2de49d2..41c57005 100644 --- a/docs/Rules/MA0119.md +++ b/docs/Rules/MA0119.md @@ -3,7 +3,7 @@ Source: [JSInteropMustNotBeUsedInOnInitializedAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/JSInteropMustNotBeUsedInOnInitializedAnalyzer.cs) -In a Blazor component, JSRuntime is not available in `OnInitialize` or `OnInitializedAsync`. The analyzer also reports usages of `ProtectedBrowserStorage` and derived classes as it uses `IJSRuntime` under the hood. +In a Blazor component, JSRuntime is not available in `OnInitialized` or `OnInitializedAsync`. The analyzer also reports usages of `ProtectedBrowserStorage` and derived classes as it uses `IJSRuntime` under the hood. > **Note** diff --git a/docs/Rules/MA0121.md b/docs/Rules/MA0121.md index dea271a7..2d1d6768 100644 --- a/docs/Rules/MA0121.md +++ b/docs/Rules/MA0121.md @@ -3,6 +3,6 @@ Source: [DoNotOverwriteRazorComponentParameterValue.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/DoNotOverwriteRazorComponentParameterValue.cs) -Providing initial values for component parameters is supported, but don't create a component that writes to its own parameters after the component is rendered for the first time. For more information, see the Overwritten parameters section of this article. +Providing initial values for component parameters is supported, but you should not create a component that writes to its own parameters after the component is rendered for the first time. For more information, see the Overwritten parameters section of this article. - [ASP.NET Core Razor components - Overwritten parameters](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-6.0&WT.mc_id=DT-MVP-5003978#overwritten-parameters) diff --git a/docs/Rules/MA0124.md b/docs/Rules/MA0124.md index dcc5551b..60e72919 100644 --- a/docs/Rules/MA0124.md +++ b/docs/Rules/MA0124.md @@ -34,7 +34,7 @@ Then, you need to add the file to the `AdditionalFiles` collection in the `cspro ```` -You can also configure the allowed types by using an assembly attribute. This attributes are applied only for the current assemblies. The rule does not consider attributes defined in referenced assemblies. +You can also configure the allowed types by using an assembly attribute. These attributes are applied only for the current assembly. The rule does not consider attributes defined in referenced assemblies. ````c# // Requires the Meziantou.Analyzer.Annotations package diff --git a/docs/Rules/MA0127.md b/docs/Rules/MA0127.md index e5a058ad..4cda0b1f 100644 --- a/docs/Rules/MA0127.md +++ b/docs/Rules/MA0127.md @@ -5,7 +5,7 @@ Sources: [UseStringEqualsInsteadOfIsPatternAnalyzer.cs](https://github.com/mezia This rule is enabled by default as a silent suggestion. -You should use `string.Equals` instead of `is`, to make string comparison rules explicit. _Similar to [MA0006](./MA0006.md) but for patterns._ +You should use `string.Equals` instead of `is`, to make string comparisons explicit. _Similar to [MA0006](./MA0006.md) but for patterns._ ````csharp _ str = is "foo"; diff --git a/docs/Rules/MA0130.md b/docs/Rules/MA0130.md index b9fe64dc..1fdebecf 100644 --- a/docs/Rules/MA0130.md +++ b/docs/Rules/MA0130.md @@ -3,7 +3,7 @@ Source: [ObjectGetTypeOnTypeInstanceAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/ObjectGetTypeOnTypeInstanceAnalyzer.cs) -`GetType()` allows to get the current type. Most of the time, when using on an instance of type `System.Type`, it's an error +`GetType()` returns the current type. Most of the time, when used on an instance of type `System.Type`, it's an error. ````c# System.Type type = ...; diff --git a/docs/Rules/MA0132.md b/docs/Rules/MA0132.md index c59651e6..a9ddab17 100644 --- a/docs/Rules/MA0132.md +++ b/docs/Rules/MA0132.md @@ -3,7 +3,7 @@ Source: [DoNotImplicitlyConvertDateTimeToDateTimeOffsetAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/DoNotImplicitlyConvertDateTimeToDateTimeOffsetAnalyzer.cs) -Implicit conversions from `DateTime` to `DateTimeOffset` are dangerous. The result depends on `DateTime.Kind` which is often `Unspecified`, and so, fallback to a local time. +Implicit conversions from `DateTime` to `DateTimeOffset` are dangerous. The result depends on `DateTime.Kind` which is often `Unspecified`, and so falls back to a local time. This may not be desired. Also, this may indicate that you are mixing `DateTime` and `DateTimeOffset` in your application, which may be unintentional. ````c# diff --git a/docs/Rules/MA0134.md b/docs/Rules/MA0134.md index 963369c1..74be5250 100644 --- a/docs/Rules/MA0134.md +++ b/docs/Rules/MA0134.md @@ -3,9 +3,9 @@ Source: [AwaitAwaitableMethodInSyncMethodAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/AwaitAwaitableMethodInSyncMethodAnalyzer.cs) -The result of awaitable method should be observed by using `await`, `Result`, `Wait`, or other methods. +The result of an awaitable method should be observed by using `await`, `Result`, `Wait`, or other methods. -Note: [CS4014](https://learn.microsoft.com/en-US/dotnet/csharp/language-reference/compiler-messages/cs4014?WT.mc_id=DT-MVP-5003978) is similar but only operate in `async` methods. MA0134 operates in non-async methods. +Note: [CS4014](https://learn.microsoft.com/en-US/dotnet/csharp/language-reference/compiler-messages/cs4014?WT.mc_id=DT-MVP-5003978) is similar but only operates in `async` methods. MA0134 operates in non-async methods. ````c# void Sample() diff --git a/docs/Rules/MA0138.md b/docs/Rules/MA0138.md index 556cf82e..97fc1cca 100644 --- a/docs/Rules/MA0138.md +++ b/docs/Rules/MA0138.md @@ -3,7 +3,7 @@ Sources: [MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs), [MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixFixer.cs) -Methods that does not return an awaitable type such as `Task` or `ValueTask` should not have an 'Async' suffix. +Methods that do not return an awaitable type such as `Task` or `ValueTask` should not have an 'Async' suffix. ````c# // compliant diff --git a/docs/Rules/MA0139.md b/docs/Rules/MA0139.md index cd39db8f..257a0213 100644 --- a/docs/Rules/MA0139.md +++ b/docs/Rules/MA0139.md @@ -34,7 +34,7 @@ Then, you need to add the file to the `AdditionalFiles` collection in the `cspro ```` -You can also configure the allowed types by using an assembly attribute. This attributes are applied only for the current assemblies. The rule does not consider attributes defined in referenced assemblies. +You can also configure the allowed types by using an assembly attribute. These attributes are applied only for the current assembly. The rule does not consider attributes defined in referenced assemblies. ````c# // Requires the Meziantou.Analyzer.Annotations package diff --git a/docs/Rules/MA0145.md b/docs/Rules/MA0145.md index 5cf3ec66..57dd5e90 100644 --- a/docs/Rules/MA0145.md +++ b/docs/Rules/MA0145.md @@ -3,9 +3,9 @@ Source: [ValidateUnsafeAccessorAttributeUsageAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/ValidateUnsafeAccessorAttributeUsageAnalyzer.cs) -Report some cases where a method decorated with `[UnsafeAccessorAttribute]` is not valid. +Reports cases where a method decorated with `[UnsafeAccessorAttribute]` has an invalid signature. -Note: Because some references doesn't expose their private members through Roslyn, it's not possible to validate the full signature. +Note: Because some references don't expose their private members through Roslyn, it's not possible to validate the full signature. ````c# [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "dummy")] diff --git a/docs/Rules/MA0146.md b/docs/Rules/MA0146.md index c344d3e1..19f64bf0 100644 --- a/docs/Rules/MA0146.md +++ b/docs/Rules/MA0146.md @@ -3,7 +3,7 @@ Sources: [ValidateUnsafeAccessorAttributeUsageAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/ValidateUnsafeAccessorAttributeUsageAnalyzer.cs), [ValidateUnsafeAccessorAttributeUsageFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/ValidateUnsafeAccessorAttributeUsageFixer.cs) -Local function names are mangle by the compiler, so the `Name` named constructor parameter is required +Local function names are mangled by the compiler, so the `Name` parameter is required. ````c# // non compliant diff --git a/docs/Rules/MA0151.md b/docs/Rules/MA0151.md index 435670f4..467ddaba 100644 --- a/docs/Rules/MA0151.md +++ b/docs/Rules/MA0151.md @@ -3,7 +3,7 @@ Source: [DebuggerDisplayAttributeShouldContainValidExpressionsAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/DebuggerDisplayAttributeShouldContainValidExpressionsAnalyzer.cs) -Validate the content +Validates the expressions within `[DebuggerDisplay]` attributes to ensure they reference valid members. ````c# [DebuggerDisplay("{Display}")] // compliant diff --git a/docs/Rules/MA0155.md b/docs/Rules/MA0155.md index 4148094c..6f5f1b61 100755 --- a/docs/Rules/MA0155.md +++ b/docs/Rules/MA0155.md @@ -4,7 +4,7 @@ Source: [DoNotUseAsyncVoidAnalyzer.cs](https://github.com/meziantou/Meziantou.An ```c# -// not-compliant +// non-compliant async void SomeMethod() { await Task.Delay(1000); diff --git a/docs/Rules/MA0162.md b/docs/Rules/MA0162.md index cd70298c..dae43eba 100644 --- a/docs/Rules/MA0162.md +++ b/docs/Rules/MA0162.md @@ -5,7 +5,7 @@ Source: [ProcessStartAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyze Detects when `Process.Start` is called without the `ProcessStartInfo` parameter. -Specifying a `ProcessStartInfo` allows to specify the `UseShellExecute` property. This value is important because the default value for this property is `true` on .NET Framework apps and `false` on .NET Core apps. It's a common issue when migrating a desktop app from .NET Framework to .NET Core. +Specifying a `ProcessStartInfo` allows you to specify the `UseShellExecute` property. This value is important because the default value for this property is `true` on .NET Framework apps and `false` on .NET Core apps. It's a common issue when migrating a desktop app from .NET Framework to .NET Core. ````c# using System.Diasgnostics; diff --git a/docs/Rules/MA0163.md b/docs/Rules/MA0163.md index 93195ea9..44ffdea8 100644 --- a/docs/Rules/MA0163.md +++ b/docs/Rules/MA0163.md @@ -7,7 +7,7 @@ Detects when `Process.Start` is called without specifying the value of `UseShell Specifying the value is important because: - The default value for this property is `true` on .NET Framework apps and `false` on .NET Core apps. It's a common issue when migrating a desktop app from .NET Framework to .NET Core. -- It must be set to to `false` when redirecting I/O. Otherwise you'll get an issue at runtime. +- It must be set to `false` when redirecting I/O. Otherwise, a runtime error will occur. ````c# diff --git a/docs/Rules/MA0164.md b/docs/Rules/MA0164.md index 1c28a08e..5757c4c9 100644 --- a/docs/Rules/MA0164.md +++ b/docs/Rules/MA0164.md @@ -21,4 +21,4 @@ _ = value is not (null or ""); // ok ```` > **Warning** -Note that the provided code fix may not always be correct. It adds parenthesis to show the current evaluation order, but this may not be what is expected. It is recommended to review the code after applying the fix. +Note that the provided code fix may not always be correct. It adds parentheses to show the current evaluation order, but this may not reflect the intended behavior. It is recommended to review the code after applying the fix. diff --git a/docs/Rules/MA0170.md b/docs/Rules/MA0170.md index 535367c8..23871645 100644 --- a/docs/Rules/MA0170.md +++ b/docs/Rules/MA0170.md @@ -3,7 +3,7 @@ Source: [TypeCannotBeUsedInAnAttributeParameterAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/TypeCannotBeUsedInAnAttributeParameterAnalyzer.cs) -Report any constructor parameters, fields, or properties that are not supported by the C# language as attribute arguments as defined in https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/attributes?WT.mc_id=DT-MVP-5003978#2224-attribute-parameter-types. +Reports constructor parameters, fields, or properties that use types not supported as attribute arguments by the C# language, as defined in https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/attributes?WT.mc_id=DT-MVP-5003978#2224-attribute-parameter-types. The types of positional and named parameters for an attribute class are limited to the attribute parameter types, which are: diff --git a/docs/Rules/MA0171.md b/docs/Rules/MA0171.md index 7708cdd6..25a85171 100644 --- a/docs/Rules/MA0171.md +++ b/docs/Rules/MA0171.md @@ -3,7 +3,7 @@ Sources: [UsePatternMatchingInsteadOfHasValueAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/UsePatternMatchingInsteadOfHasValueAnalyzer.cs), [UsePatternMatchingInsteadOfHasvalueFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingInsteadOfHasvalueFixer.cs) -Use pattern matching instead of the `HasValue` property to check for non-nullable value types or nullable value types. +Use pattern matching instead of the `HasValue` property when checking if a nullable value type has a value. ````c# int? value = null;