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: Add inline comments, remove info.xml #1155

Merged
merged 29 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
12ae8a5
add limited src .editorconfig
DaveSkender Jan 28, 2024
65a4253
XML comment example
DaveSkender Jan 28, 2024
6a8e996
record class examples
DaveSkender Jan 28, 2024
75ca11d
fix config per spect
DaveSkender Jan 28, 2024
e2a3f46
Merge branch 'v3' into inline-docs
DaveSkender Mar 2, 2024
82d3771
add v3 to build
DaveSkender Mar 2, 2024
b6f2751
Merge branch 'v3' into inline-docs
DaveSkender Mar 31, 2024
b2702e1
Merge branch 'main' into inline-docs
DaveSkender Apr 1, 2024
f844357
Merge branch 'v3' into inline-docs
DaveSkender Apr 1, 2024
8f8e4b7
simplify NuGet project description, tags
DaveSkender Jun 20, 2024
39ad106
remove unneeded NuGet release notes link
DaveSkender Jun 23, 2024
d1a6aee
Merge branch 'v3' into inline-docs
DaveSkender Jul 30, 2024
6b80820
add recommended VS Code extensions
DaveSkender Oct 28, 2024
051aadf
Merge branch 'v3' into inline-docs
DaveSkender Oct 28, 2024
59644b3
revert restore of .NET Standard 2.1
DaveSkender Nov 2, 2024
1fa451a
Merge branch 'v3' into inline-docs
DaveSkender Nov 3, 2024
8fe57d9
A and common
DaveSkender Nov 3, 2024
4e657a9
fix inheritdoc
DaveSkender Nov 3, 2024
afb2938
B-C and more common utils
DaveSkender Nov 4, 2024
f086f9f
use central package versioning
DaveSkender Nov 10, 2024
dab9332
D
DaveSkender Nov 10, 2024
9c77bcf
E-K
DaveSkender Nov 10, 2024
23058cc
M-R
DaveSkender Nov 10, 2024
679aa65
S-Z
DaveSkender Nov 10, 2024
4417e26
update .editorconfig
DaveSkender Nov 11, 2024
9c7e77b
add missed XML comments
DaveSkender Nov 11, 2024
c3bafa9
fix: Bad replacement
DaveSkender Nov 11, 2024
ad6225b
minor cosmetic cleanup
DaveSkender Nov 11, 2024
696b8a7
drop last `info.xml` file
DaveSkender Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
152 changes: 87 additions & 65 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# top-most EditorConfig file
root = true

# global baselines
#### Core EditorConfig Options ####
[*]
charset = utf-8
end_of_line = lf
Expand All @@ -11,116 +11,138 @@ indent_size = 2
tab_width = 2

line_length = 150
max_line_length = 150
trim_trailing_whitespace = true
insert_final_newline = true

[*.{cs,vb}]
tab_width = 4
# .NET Globals
[*.cs]
indent_size = 4
tab_width = 4

#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
#### .NET Coding Conventions ####
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/overview

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true
file_header_template = unset

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members

# Symbol specifications
# Expression-level preferences
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_namespace_match_folder = false:none
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true

# Collection expression preferences
dotnet_style_prefer_collection_expression = true:suggestion
dotnet_diagnostic.IDE0305.severity = none # exclude collection expression for fluent
csharp_space_between_square_brackets = false
csharp_space_between_empty_square_brackets = false

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity

# Code block and new line preferences
dotnet_style_prefer_braces = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = false

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
# Field preferences
dotnet_style_readonly_field = true

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Assignment preferences
dotnet_code_quality_unused_parameters = warning
dotnet_code_quality_unused_value = warning

# Naming styles
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = suggestion

# Naming conventions
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_code_quality_explicit_tuple_names = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_code_quality_unused_parameters = all:suggestion
#### C# Coding Conventions ####
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options

dotnet_sort_system_directives_first = true

dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_namespace_match_folder = false:none
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_prefer_collection_expression = false:suggestion

[*.cs]
# ref: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options
# var preferences
csharp_style_var_elsewhere = false
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = false

# Labeling and using directives
csharp_indent_labels = one_less_than_current
csharp_using_directive_placement = outside_namespace:warning
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_static_local_function = true:suggestion

# Namespace and method preferences
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion

# Expression-bodied Members
csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent

# Function preferences
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_unused_value_assignment_preference = unused_local_variable:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion

# Variable declarations
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = unused_local_variable:suggestion

# Modifier preferences
csharp_prefer_static_local_function = true
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
csharp_style_prefer_readonly_struct = true
csharp_style_prefer_readonly_struct_member = true

# braces
# Code block preferences
csharp_prefer_braces = true:suggestion
csharp_prefer_simple_using_statement = true:suggestion
csharp_type_declaration_braces = next_line
csharp_empty_block_style = together_same_line

# New line preferences
csharp_new_line_before_open_brace = methods, properties, control_blocks, types
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = false
csharp_new_line_before_members_in_anonymous_types = false
csharp_new_line_between_query_expression_clauses = false

# braces overrides
csharp_type_declaration_braces = next_line
csharp_empty_block_style = together_same_line

# diagnostic analyzers
dotnet_diagnostic.CA1303.severity = none
dotnet_diagnostic.CS1591.severity = silent
dotnet_diagnostic.IDE0058.severity = none
25 changes: 9 additions & 16 deletions .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
dotnet-quality: "ga"

- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
Expand All @@ -51,21 +57,8 @@ jobs:
- name: Compose version
id: compose
run: |
ver=${{ steps.gitversion.outputs.majorMinorPatch }}${{ inputs.preview && '-preview.' || '' }}${{ inputs.preview && steps.gitversion.outputs.preReleaseNumber || inputs.preview && github.run_number || '' }}
echo "version=$ver" >> "$GITHUB_OUTPUT"

- name: Update release notes URL
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "<PackageReleaseNotes>https://github.com/DaveSkender/Stock.Indicators/releases</PackageReleaseNotes>"
replace: "<PackageReleaseNotes>https://github.com/DaveSkender/Stock.Indicators/releases/tag/${{ steps.compose.outputs.version }}</PackageReleaseNotes>"
regex: false

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
dotnet-quality: "ga"
composed_version=${{ steps.gitversion.outputs.majorMinorPatch }}${{ inputs.preview && '-preview.' || '' }}${{ inputs.preview && steps.gitversion.outputs.preReleaseNumber || inputs.preview && github.run_number || '' }}
echo "version=$composed_version" >> "$GITHUB_OUTPUT"

- name: Build library
run: >
Expand Down Expand Up @@ -100,7 +93,7 @@ jobs:
echo "| Minor | ${{ steps.gitversion.outputs.minor }} |"
echo "| Patch | ${{ steps.gitversion.outputs.patch }} |"
echo "| Base | ${{ steps.gitversion.outputs.majorMinorPatch }} |"
echo "| Composed | ${{ steps.compose.outputs.version }} |"
echo "| Composed | ${{ steps.compose.outputs.version }} |"
} >> $GITHUB_STEP_SUMMARY

deploy:
Expand Down
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"codacy-app.codacy",
"adrianwilczynski.user-secrets",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"mechatroner.rainbow-csv",
"dotjoshjohnson.xml",
"redhat.vscode-yaml",
"vunguyentuan.vscode-css-variables"
]
}
39 changes: 3 additions & 36 deletions docs/examples/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
# top-most EditorConfig file
root = true

# global baselines
[*]
charset = utf-8
end_of_line = lf

indent_style = space
indent_size = 2
tab_width = 2

line_length = 150
max_line_length = 150
trim_trailing_whitespace = true
insert_final_newline = true

[*.{csproj,props,targets}]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2

[*.{cs,vb}]
tab_width = 4
indent_size = 4
end_of_line = lf

#### Naming styles ####

# Naming styles

dotnet_style_namespace_match_folder = false:none
# code analysis for EXAMPLES only
root = false

[*.cs]
dotnet_diagnostic.IDE0058.severity = none
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for public members
5 changes: 5 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# code analysis for SRC only
root = false

[*.cs]
dotnet_diagnostic.CS1591.severity = suggestion # Missing XML comment for public members
10 changes: 10 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>
</Project>
Loading