Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor port to triple slash #164

Merged
merged 20 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ charset = utf-8
# Generated code
[*{_AssemblyInfo.cs,.notsupported.cs,AsmOffsets.cs}]
generated_code = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion

# C# files
[*.cs]
Expand Down Expand Up @@ -56,15 +61,15 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
# name all constant fields using PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
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
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_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
Expand All @@ -74,7 +79,7 @@ dotnet_naming_style.static_prefix_style.capitalization = camel_case
# internal and private fields should be _camelCase
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
Expand Down Expand Up @@ -157,8 +162,19 @@ csharp_space_between_square_brackets = false
dotnet_diagnostic.IDE0073.severity = error
# License header
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion

# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = error

# C++ Files

# xUnit1006: Theory methods should have parameters
dotnet_diagnostic.xUnit1006.severity = error

[*.{cpp,h,in}]
curly_bracket_next_line = true
indent_brace_style = Allman
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ syntax: glob
*.sln.docstates
launchSettings.json

# Live Unit Tests
.lutignore
*.lutconfig

# Build results

artifacts/
Expand Down Expand Up @@ -130,4 +134,4 @@ node_modules/

# Python Compile Outputs

*.pyc
*.pyc
5 changes: 5 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
</Project>
19 changes: 18 additions & 1 deletion src/PortToTripleSlash/src/libraries/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ private enum Mode
Initial,
IsMono,
SkipInterfaceImplementations,
SkipInterfaceRemarks
SkipInterfaceRemarks,
SkipRemarks
}

// The default boilerplate string for what dotnet-api-docs
Expand Down Expand Up @@ -64,6 +65,7 @@ private enum Mode
public bool IsMono { get; set; }
public bool SkipInterfaceImplementations { get; set; } = false;
public bool SkipInterfaceRemarks { get; set; } = true;
public bool SkipRemarks { get; set; } = true;

public static Configuration GetCLIArguments(string[] args)
{
Expand Down Expand Up @@ -331,6 +333,10 @@ public static Configuration GetCLIArguments(string[] args)
mode = Mode.SkipInterfaceRemarks;
break;

case "-SKIPREMARKS":
mode = Mode.SkipRemarks;
break;

default:
Log.ErrorAndExit($"Unrecognized argument: {arg}");
break;
Expand Down Expand Up @@ -358,6 +364,13 @@ public static Configuration GetCLIArguments(string[] args)
break;
}

case Mode.SkipRemarks:
{
config.SkipRemarks = ParseOrExit(arg, nameof(Mode.SkipRemarks));
mode = Mode.Initial;
break;
}

default:
{
Log.ErrorAndExit("Unexpected mode.");
Expand Down Expand Up @@ -490,6 +503,10 @@ Whether you want interface implementation remarks to be used when the API itself
the interface API.
Usage example:
-SkipInterfaceRemarks false
-SkipRemarks bool Default is true (excludes remarks).
Whether you want to backport remarks.
Usage example:
-SkipRemarks true
");
Log.Warning(@"
TL;DR:
Expand Down
Loading
Loading