Граф коммитов

7 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 21acc1d420
Update editorconfig. (#19909)
* Make the preference about removing default access modifiers
  (dotnet_style_require_accessibility_modifiers) a warning so that `dotnet
  format` fixes any such issues.
* Change the 'var' style when type is apparent to use 'var' instead of the
  type (this seems to be what we do in most places anyways), and make it a
  warning so that `dotnet format` fixes any such issues.
2024-01-26 08:24:58 +01:00
Manuel de la Pena 1681e9f915
[Code Style] Add some extra style checks focused on nullability. (#17831)
Added the following new checks:

```csharp
// dotnet_style_coalesce_expression = true
var v = x ?? y;

// dotnet_style_coalesce_expression = false
var v = x != null ? x : y; // or
var v = x == null ? y : x;
```

```csharp
// dotnet_style_null_propagation = true
var v = o?.ToString();

// dotnet_style_null_propagation = false
var v = o == null ? null : o.ToString(); // or
var v = o != null ? o.String() : null;
```

```csharp
// dotnet_style_prefer_is_null_check_over_reference_equality_method = true
if (value is null)
    return;

// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if (object.ReferenceEquals(value, null))
    return;

// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if ((object)o == null)
    return;
```
2023-06-22 13:31:04 -04:00
Rolf Bjarne Kvinge ecbdf18ec1 Add editorconfig entries for Visual Basic. 2023-01-31 13:14:46 +01:00
Rolf Bjarne Kvinge d251b69ae7
[generator] Don't use culture-aware API. (#15392)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-07-11 19:59:36 +02:00
Manuel de la Pena c2b7df3e41
[Build] Do not show the deprecated warnings. (#12683)
We are adding the warnings for net6 for customers, but those same
warnins do appear when we build the intermediate assembly and makes it
very very noise and hard to find errors. We can disable them for our
projects via stating that they are generated.
2021-09-14 10:30:41 -04:00
Rolf Bjarne Kvinge e0b52142c1
[editorconfig] Set the charset to utf-8. (#11795)
An additional point here is that the 'utf-8' charset is specifically defined
to not include the byte-order-mark.

Ref: https://editorconfig.org
2021-06-03 18:45:29 +02:00
Přemek Vysoký bc9acaee33
Add .editorconfig (#8058) 2020-03-10 11:24:46 -04:00