Skip to content

Commit 283b60a

Browse files
Merge pull request #385 from tannergooding/main
Updating the .editorconfig to have support newer rules
2 parents f599d4d + d843685 commit 283b60a

File tree

789 files changed

+44531
-45257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

789 files changed

+44531
-45257
lines changed

.editorconfig

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ end_of_line = lf
2121
insert_final_newline = true
2222
indent_style = space
2323
indent_size = 4
24+
tab_width = 4
2425
trim_trailing_whitespace = true
2526

2627
###############################################################################
@@ -176,6 +177,7 @@ dotnet_sort_system_directives_first = true
176177
# require null-coalescing expressions,
177178
# require collection-initializers,
178179
# require explicit tuple names,
180+
# suggest namespace match folder names,
179181
# require null-propogation
180182
# require object-initializers,
181183
#
@@ -210,6 +212,7 @@ dotnet_sort_system_directives_first = true
210212
dotnet_style_coalesce_expression = true:error
211213
dotnet_style_collection_initializer = true:error
212214
dotnet_style_explicit_tuple_names = true:error
215+
dotnet_style_namespace_match_folder = true:suggestion
213216
dotnet_style_null_propagation = true:error
214217
dotnet_style_object_initializer = true:error
215218

@@ -372,16 +375,18 @@ csharp_space_between_square_brackets = false
372375
# require expression-bodied operators when on a single line,
373376
# require expression-bodied properties when on a single line,
374377
#
375-
# error on simplified new expression,
378+
# error on new expressions when created type is apparent
376379
#
377380
# require inlined variable declarations,
378381
#
382+
# require file scoped namespace declarations,
383+
#
379384
# require local over anonymous functions,
380385
# require pattern-matching over "as" with "null" check,
381386
# require pattern-matching over "is" with "cast" check,
382387
#
383-
# require index operators where possible,
384-
# require range operators where possible,
388+
# error on index operators where possible,
389+
# error on range operators where possible,
385390
# require the "not" pattern where possible,
386391
# require pattern-matching where possible,
387392
# require switch expressions where possible,
@@ -412,14 +417,17 @@ csharp_style_implicit_object_creation_when_type_is_apparent = false:error
412417

413418
csharp_style_inlined_variable_declaration = true:error
414419

420+
csharp_style_namespace_declarations = file_scoped:error
421+
415422
csharp_style_pattern_local_over_anonymous_function = true:error
416423
csharp_style_pattern_matching_over_as_with_null_check = true:error
417424
csharp_style_pattern_matching_over_is_with_cast_check = true:error
418425

419-
csharp_style_prefer_index_operator = true:error
420-
csharp_style_prefer_range_operator = true:error
426+
csharp_style_prefer_index_operator = false:error
427+
csharp_style_prefer_method_group_conversion = true:suggestion
421428
csharp_style_prefer_not_pattern = true:error
422429
csharp_style_prefer_pattern_matching = true:error
430+
csharp_style_prefer_range_operator = false:error
423431
csharp_style_prefer_switch_expression = true:error
424432

425433
csharp_style_throw_expression = true:error
@@ -439,8 +447,7 @@ csharp_style_var_when_type_is_apparent = true:error
439447
csharp_using_directive_placement = outside_namespace:error
440448

441449
###############################################################################
442-
# Supress diagnostics that don't apply to ClangSharp
450+
# Set dotnet analyzer rules to:
451+
# disable CA1401: P/Invoke method '*' should not be visible
443452
###############################################################################
444-
dotnet_diagnostic.CA1069.severity = none
445-
dotnet_diagnostic.CA1826.severity = none
446-
dotnet_diagnostic.IDE0060.severity = none
453+
dotnet_diagnostic.CA1401.severity = silent

sources/ClangSharp.Interop/.editorconfig

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
2+
13
###############################################################################
24
# EditorConfig is awesome: http://EditorConfig.org
35
###############################################################################
@@ -23,6 +25,17 @@ dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.sever
2325
dotnet_naming_rule.type_parameters_should_be_pascal_case_prefixed_with_t.severity = none
2426

2527
###############################################################################
26-
# Supress diagnostics that don't apply to ClangSharp P/Invokes
27-
###############################################################################
28-
dotnet_diagnostic.CA1401.severity = none
28+
# Set dotnet style options to:
29+
# disable certain parent style options since they are not applicable to interop
30+
###############################################################################
31+
csharp_style_expression_bodied_methods = when_on_single_line:none
32+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:none
33+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
34+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:none
35+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:none
36+
dotnet_style_prefer_conditional_expression_over_assignment = true:none
37+
dotnet_style_prefer_conditional_expression_over_return = true:none
38+
csharp_style_prefer_pattern_matching = true:none
39+
csharp_style_var_elsewhere = true:none
40+
csharp_style_var_for_built_in_types = true:none
41+
csharp_style_var_when_type_is_apparent = true:none

sources/ClangSharp.Interop/CXAvailabilityKind.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public enum CXAvailabilityKind
79
{
8-
public enum CXAvailabilityKind
9-
{
10-
CXAvailability_Available,
11-
CXAvailability_Deprecated,
12-
CXAvailability_NotAvailable,
13-
CXAvailability_NotAccessible,
14-
}
10+
CXAvailability_Available,
11+
CXAvailability_Deprecated,
12+
CXAvailability_NotAvailable,
13+
CXAvailability_NotAccessible,
1514
}

sources/ClangSharp.Interop/CXCallingConv.cs

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,29 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public enum CXCallingConv
79
{
8-
public enum CXCallingConv
9-
{
10-
CXCallingConv_Default = 0,
11-
CXCallingConv_C = 1,
12-
CXCallingConv_X86StdCall = 2,
13-
CXCallingConv_X86FastCall = 3,
14-
CXCallingConv_X86ThisCall = 4,
15-
CXCallingConv_X86Pascal = 5,
16-
CXCallingConv_AAPCS = 6,
17-
CXCallingConv_AAPCS_VFP = 7,
18-
CXCallingConv_X86RegCall = 8,
19-
CXCallingConv_IntelOclBicc = 9,
20-
CXCallingConv_Win64 = 10,
21-
CXCallingConv_X86_64Win64 = CXCallingConv_Win64,
22-
CXCallingConv_X86_64SysV = 11,
23-
CXCallingConv_X86VectorCall = 12,
24-
CXCallingConv_Swift = 13,
25-
CXCallingConv_PreserveMost = 14,
26-
CXCallingConv_PreserveAll = 15,
27-
CXCallingConv_AArch64VectorCall = 16,
28-
CXCallingConv_SwiftAsync = 17,
29-
CXCallingConv_Invalid = 100,
30-
CXCallingConv_Unexposed = 200,
31-
}
10+
CXCallingConv_Default = 0,
11+
CXCallingConv_C = 1,
12+
CXCallingConv_X86StdCall = 2,
13+
CXCallingConv_X86FastCall = 3,
14+
CXCallingConv_X86ThisCall = 4,
15+
CXCallingConv_X86Pascal = 5,
16+
CXCallingConv_AAPCS = 6,
17+
CXCallingConv_AAPCS_VFP = 7,
18+
CXCallingConv_X86RegCall = 8,
19+
CXCallingConv_IntelOclBicc = 9,
20+
CXCallingConv_Win64 = 10,
21+
CXCallingConv_X86_64Win64 = CXCallingConv_Win64,
22+
CXCallingConv_X86_64SysV = 11,
23+
CXCallingConv_X86VectorCall = 12,
24+
CXCallingConv_Swift = 13,
25+
CXCallingConv_PreserveMost = 14,
26+
CXCallingConv_PreserveAll = 15,
27+
CXCallingConv_AArch64VectorCall = 16,
28+
CXCallingConv_SwiftAsync = 17,
29+
CXCallingConv_Invalid = 100,
30+
CXCallingConv_Unexposed = 200,
3231
}

sources/ClangSharp.Interop/CXChildVisitResult.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public enum CXChildVisitResult
79
{
8-
public enum CXChildVisitResult
9-
{
10-
CXChildVisit_Break,
11-
CXChildVisit_Continue,
12-
CXChildVisit_Recurse,
13-
}
10+
CXChildVisit_Break,
11+
CXChildVisit_Continue,
12+
CXChildVisit_Recurse,
1413
}

sources/ClangSharp.Interop/CXCodeCompleteResults.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public unsafe partial struct CXCodeCompleteResults
79
{
8-
public unsafe partial struct CXCodeCompleteResults
9-
{
10-
public CXCompletionResult* Results;
10+
public CXCompletionResult* Results;
1111

12-
[NativeTypeName("unsigned int")]
13-
public uint NumResults;
14-
}
12+
[NativeTypeName("unsigned int")]
13+
public uint NumResults;
1514
}

sources/ClangSharp.Interop/CXCodeComplete_Flags.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public enum CXCodeComplete_Flags
79
{
8-
public enum CXCodeComplete_Flags
9-
{
10-
CXCodeComplete_IncludeMacros = 0x01,
11-
CXCodeComplete_IncludeCodePatterns = 0x02,
12-
CXCodeComplete_IncludeBriefComments = 0x04,
13-
CXCodeComplete_SkipPreamble = 0x08,
14-
CXCodeComplete_IncludeCompletionsWithFixIts = 0x10,
15-
}
10+
CXCodeComplete_IncludeMacros = 0x01,
11+
CXCodeComplete_IncludeCodePatterns = 0x02,
12+
CXCodeComplete_IncludeBriefComments = 0x04,
13+
CXCodeComplete_SkipPreamble = 0x08,
14+
CXCodeComplete_IncludeCompletionsWithFixIts = 0x10,
1615
}

sources/ClangSharp.Interop/CXComment.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public unsafe partial struct CXComment
79
{
8-
public unsafe partial struct CXComment
9-
{
10-
[NativeTypeName("const void *")]
11-
public void* ASTNode;
10+
[NativeTypeName("const void *")]
11+
public void* ASTNode;
1212

13-
[NativeTypeName("CXTranslationUnit")]
14-
public CXTranslationUnitImpl* TranslationUnit;
15-
}
13+
[NativeTypeName("CXTranslationUnit")]
14+
public CXTranslationUnitImpl* TranslationUnit;
1615
}

sources/ClangSharp.Interop/CXCommentInlineCommandRenderKind.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public enum CXCommentInlineCommandRenderKind
79
{
8-
public enum CXCommentInlineCommandRenderKind
9-
{
10-
CXCommentInlineCommandRenderKind_Normal,
11-
CXCommentInlineCommandRenderKind_Bold,
12-
CXCommentInlineCommandRenderKind_Monospaced,
13-
CXCommentInlineCommandRenderKind_Emphasized,
14-
CXCommentInlineCommandRenderKind_Anchor,
15-
}
10+
CXCommentInlineCommandRenderKind_Normal,
11+
CXCommentInlineCommandRenderKind_Bold,
12+
CXCommentInlineCommandRenderKind_Monospaced,
13+
CXCommentInlineCommandRenderKind_Emphasized,
14+
CXCommentInlineCommandRenderKind_Anchor,
1615
}

sources/ClangSharp.Interop/CXCommentKind.cs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
// Ported from https://github.com/llvm/llvm-project/tree/llvmorg-14.0.0/clang/include/clang-c
44
// Original source is Copyright (c) the LLVM Project and Contributors. Licensed under the Apache License v2.0 with LLVM Exceptions. See NOTICE.txt in the project root for license information.
55

6-
namespace ClangSharp.Interop
6+
namespace ClangSharp.Interop;
7+
8+
public enum CXCommentKind
79
{
8-
public enum CXCommentKind
9-
{
10-
CXComment_Null = 0,
11-
CXComment_Text = 1,
12-
CXComment_InlineCommand = 2,
13-
CXComment_HTMLStartTag = 3,
14-
CXComment_HTMLEndTag = 4,
15-
CXComment_Paragraph = 5,
16-
CXComment_BlockCommand = 6,
17-
CXComment_ParamCommand = 7,
18-
CXComment_TParamCommand = 8,
19-
CXComment_VerbatimBlockCommand = 9,
20-
CXComment_VerbatimBlockLine = 10,
21-
CXComment_VerbatimLine = 11,
22-
CXComment_FullComment = 12,
23-
}
10+
CXComment_Null = 0,
11+
CXComment_Text = 1,
12+
CXComment_InlineCommand = 2,
13+
CXComment_HTMLStartTag = 3,
14+
CXComment_HTMLEndTag = 4,
15+
CXComment_Paragraph = 5,
16+
CXComment_BlockCommand = 6,
17+
CXComment_ParamCommand = 7,
18+
CXComment_TParamCommand = 8,
19+
CXComment_VerbatimBlockCommand = 9,
20+
CXComment_VerbatimBlockLine = 10,
21+
CXComment_VerbatimLine = 11,
22+
CXComment_FullComment = 12,
2423
}

0 commit comments

Comments
 (0)