Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
22ed7ca
Fix some Resharper issues
stricq Jul 11, 2024
e9e6e40
Merge branch 'dev' of https://github.com/stricq/STR.Common into dev
stricq Jul 11, 2024
1b06a2e
Update Nugets, fix Resharper issues
stricq Oct 26, 2024
8f2c8ca
Update Nugets; Start with GitHub Actions
stricq Mar 13, 2025
c1b463a
Merge branch 'master' into dev
stricq Mar 13, 2025
b73d0b2
Add build-publish.yml
stricq Mar 14, 2025
472d654
test hash
stricq Mar 14, 2025
225e500
test hash 2
stricq Mar 14, 2025
4d27dd7
test 3
stricq Mar 14, 2025
4fed1c1
jdate 1
stricq Mar 14, 2025
f03b7bf
Add clean and build
stricq Mar 14, 2025
6061be5
Add build_publish
stricq Mar 14, 2025
0992b55
Remove if set needs
stricq Mar 14, 2025
48bef1c
change split
stricq Mar 14, 2025
ecd6aad
Add $
stricq Mar 14, 2025
2d73c39
fix split
stricq Mar 14, 2025
759e2dd
fix assignment syntax
stricq Mar 14, 2025
7ee868e
bash if syntax
stricq Mar 14, 2025
ebea837
Forgot $s
stricq Mar 14, 2025
27996d7
More bash syntax
stricq Mar 14, 2025
9537531
bash you don't know man
stricq Mar 14, 2025
653f7c8
is this it
stricq Mar 14, 2025
176b7f2
add quotes
stricq Mar 14, 2025
cc32fcd
try single quotes
stricq Mar 14, 2025
2b18c80
debug
stricq Mar 14, 2025
e42b5f5
argh it was multiline
stricq Mar 14, 2025
7da8fdf
and now
stricq Mar 14, 2025
fceaee6
Add packages.lock.json
stricq Mar 14, 2025
917270d
wild guess
stricq Mar 14, 2025
d39fd67
guess 2
stricq Mar 14, 2025
05674fd
guess 2a
stricq Mar 14, 2025
adc3dc0
guess 3
stricq Mar 14, 2025
898e2c5
fix fake version
stricq Mar 14, 2025
9f0ca46
version guess
stricq Mar 14, 2025
3911478
test vars
stricq Mar 14, 2025
67ba4f5
Hopefully final form
stricq Mar 14, 2025
c54f59d
Deactivate Jenkinsfile
stricq Mar 14, 2025
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
140 changes: 133 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ csharp_preserve_single_line_statements=true
#Style - Code block preferences

#prefer no curly braces if allowed
csharp_prefer_braces=false:suggestion
csharp_prefer_braces= false:suggestion

#Style - expression bodied member options

#prefer expression-bodied members for accessors
csharp_style_expression_bodied_accessors=true:suggestion
csharp_style_expression_bodied_accessors= true:suggestion
#prefer block bodies for constructors
csharp_style_expression_bodied_constructors=false:suggestion
csharp_style_expression_bodied_constructors= false:suggestion
#prefer expression-bodied members for indexers
csharp_style_expression_bodied_indexers=true:suggestion
csharp_style_expression_bodied_indexers= true:suggestion
#prefer block bodies for methods
csharp_style_expression_bodied_methods=when_on_single_line
csharp_style_expression_bodied_methods= when_on_single_line:silent
#prefer expression-bodied members for properties
csharp_style_expression_bodied_properties=true:suggestion
csharp_style_expression_bodied_properties= true:suggestion

#Style - expression level options

Expand All @@ -79,7 +79,7 @@ dotnet_style_predefined_type_for_member_access=true:suggestion
#Style - Expression-level preferences

#prefer default(T) over default
csharp_prefer_simple_default_expression=false:suggestion
csharp_prefer_simple_default_expression= false:suggestion

#Style - implicit and explicit types

Expand Down Expand Up @@ -130,3 +130,129 @@ dotnet_remove_unnecessary_suppression_exclusions=category: ReSharper

# ReSharper properties
resharper_space_within_single_line_array_initializer_braces=true

[*.cs]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.async_method_should_be_pascal_case_async.severity = warning
dotnet_naming_rule.async_method_should_be_pascal_case_async.symbols = async_method
dotnet_naming_rule.async_method_should_be_pascal_case_async.style = pascal_case_async

dotnet_naming_rule.method_should_be_pascal_case.severity = warning
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.async_method.applicable_kinds = method
dotnet_naming_symbols.async_method.applicable_accessibilities = *
dotnet_naming_symbols.async_method.required_modifiers = async

dotnet_naming_symbols.method.applicable_kinds = method
dotnet_naming_symbols.method.applicable_accessibilities = public
dotnet_naming_symbols.method.required_modifiers =

# Naming styles

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

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
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
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 = false:suggestion
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_indent_labels = one_less_than_current
csharp_space_around_binary_operators = before_and_after

[*.{cs,vb}]
#### 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

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

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

# Symbol specifications

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 =

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 =

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 =

# Naming styles

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_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_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_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_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
92 changes: 92 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build and Publish
on: [push, workflow_dispatch]

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NUGET_DIR: ${{ github.workspace }}/nuget

jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .Net
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
cache: true
cache-dependency-path: '**/packages.lock.json'

- name: Restore Nuget Packages
run: dotnet restore --locked-mode

- name: Clean Debug
run: dotnet clean --configuration Debug

- name: Build Debug
run: dotnet build --configuration Debug --no-restore --packages ./.nuget/packages

- name: Unit Tests
run: dotnet test --configuration Debug --no-build --filter TestCategory=Unit

build_publish:
if: ${{ startsWith(github.ref_name, 'prerelease') || startsWith(github.ref_name, 'release') }}
runs-on: ubuntu-latest
needs: [unit_tests]
steps:
- uses: actions/checkout@v4

- name: Setup .Net
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
cache: true
cache-dependency-path: '**/packages.lock.json'

- name: Setup Environment Variables
run: |
github_sha_hash=${{ github.sha }}

git_hash="${github_sha_hash:0:7}"

TZ=America/Denver

printf -v jdate '%(%y%j%H%M)T'

branch_name=${{github.ref_name}}

values=(${branch_name//_/ })

branch=${values[0]}
version=${values[1]}

if [ $branch == 'release' ]; then
branch_version="${version}+${git_hash}"
elif [ $branch == 'dev' ]; then
branch_version="9.0.0-pre.${jdate}+${git_hash}"
else
branch_version="${version}-pre.${jdate}+${git_hash}"
fi

echo $branch_version

echo "BRANCH_VERSION=${branch_version}" >> "$GITHUB_ENV"

- name: Restore Nuget Packages
run: dotnet restore --locked-mode

- name: Clean Release
run: dotnet clean --configuration Release

- name: Build Release
run: dotnet build --configuration Release --no-restore -p:Version="$BRANCH_VERSION" -p:PublishRepositoryUrl=true

- name: Package Nuget
run: dotnet pack --configuration Release --no-build --include-symbols -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion="$BRANCH_VERSION" --output "$NUGET_DIR"

- name: Publish Nuget
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push "$NUGET_DIR\*.nupkg" -k "$NUGET_API_KEY"
File renamed without changes.
17 changes: 14 additions & 3 deletions STR.Common.sln
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
# Visual Studio Version 17
VisualStudioVersion = 17.13.35828.75
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Str.Common", "Str.Common\Str.Common.csproj", "{5E07704B-4938-4D5F-A695-F87E016AC7BF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A51EE79F-F52E-4DDD-9FBB-F0A5BE4EC2DE}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Jenkinsfile = Jenkinsfile
LICENSE = LICENSE
Jenkinsfile.old = Jenkinsfile.old
ReadMe.md = ReadMe.md
STR.Common.sln.DotSettings = STR.Common.sln.DotSettings
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Str.Common.Tests", "Str.Common.Tests\Str.Common.Tests.csproj", "{4FB30997-A73F-485F-BC45-62B6D3B8944C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{9E962354-5E96-438D-B5CE-E6BFD20D2152}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build-publish.yml = .github\workflows\build-publish.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -34,6 +41,10 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {A51EE79F-F52E-4DDD-9FBB-F0A5BE4EC2DE}
{9E962354-5E96-438D-B5CE-E6BFD20D2152} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0157AB65-53CD-4464-B113-6D50BE77B2FA}
EndGlobalSection
Expand Down
6 changes: 5 additions & 1 deletion STR.Common.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForSimpleTypes/@EntryValue">UseExplicitType</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Parameters/@EntryIndexedValue">&lt;Policy Inspect="False" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=8a85b61a_002D1024_002D4f87_002Db9ef_002D1fdae19930a1/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Any" Description="Parameters"&gt;&lt;ElementKinds&gt;&lt;Kind Name="PARAMETER" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="False" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/Environment/Editor/MatchingBraceHighlighting/Position/@EntryValue">BOTH_SIDES</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Loading