Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8763a08
feat: remove all data
MaxLevs Nov 15, 2024
c9c73fc
feat: add new structures
MaxLevs Nov 15, 2024
9186e5e
Merge pull request #4 from MaxLevs/net8-update
MaxLevs Nov 16, 2024
433fc42
feat: finish request forming
MaxLevs Nov 16, 2024
9aac615
feat: basic status implementation
MaxLevs Nov 16, 2024
36a126e
feat: create template for full status parser
MaxLevs Nov 16, 2024
2eea0ee
feat: implement parsing of full status response
MaxLevs Nov 16, 2024
e921749
docs: add some docs
MaxLevs Nov 16, 2024
fc64383
chore: empty lines
MaxLevs Nov 18, 2024
3520dc4
Update README.md
MaxLevs Nov 18, 2024
81e5752
refactor: reorder and cleanup + editorconfig
MaxLevs Nov 19, 2024
ed4c759
feat: implement concurrency
MaxLevs Nov 19, 2024
39be8a4
fix: circular disposing
MaxLevs Nov 19, 2024
dcb9652
refactor: small fixes
MaxLevs Nov 19, 2024
1ed0e50
feat: add simple sample project
MaxLevs Nov 19, 2024
e2b47b8
refactor: small changes
MaxLevs Nov 19, 2024
91594ef
feat: add github actions
MaxLevs Nov 19, 2024
f73b6d3
Merge branch 'master' into new-interface
MaxLevs Nov 19, 2024
7650b2c
fix: package build
MaxLevs Nov 19, 2024
893463d
chore: remove obsolete files
MaxLevs Nov 19, 2024
ee837e8
chore: add dict
MaxLevs Nov 19, 2024
8c88eef
build(fix): rename VERSION_SUFFIX env to BUILD_NUMBER
MaxLevs Nov 19, 2024
65c37ab
fix: naming
MaxLevs Nov 19, 2024
5a6e57a
chore: small fixes in samples
MaxLevs Nov 20, 2024
e0592db
fix: ci
MaxLevs Nov 20, 2024
b398c37
fix: line endings
MaxLevs Nov 20, 2024
e81c6ef
fix: broken pipline
MaxLevs Nov 20, 2024
3abbaf6
docs: add xml docs into nuget
MaxLevs Nov 20, 2024
6a2d081
fix: update checkout
MaxLevs Nov 20, 2024
ff8eb2e
fix: update download artifacts version
MaxLevs Nov 20, 2024
b8a4d98
docs: update readme
MaxLevs Nov 20, 2024
458b3d8
fix: temp versioning
MaxLevs Nov 20, 2024
aed9e9d
fix: publishing
MaxLevs Nov 20, 2024
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
260 changes: 260 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

# XML project files
[*.csproj]
indent_size = 2

resharper_space_before_self_closing = true

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# Shell script files
[*.sh]
indent_size = 2

# CSharp code style settings:
[*.cs]
indent_size = 4

# Non-private static fields are PascalCase
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = warning
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static

# Private static fields are camelCase
dotnet_naming_rule.private_static_fields_should_be_camel_case.severity = warning
dotnet_naming_rule.private_static_fields_should_be_camel_case.symbols = private_static_fields
dotnet_naming_rule.private_static_fields_should_be_camel_case.style = camel_case_style

dotnet_naming_symbols.private_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields.required_modifiers = static

# Non-private readonly fields are PascalCase
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = warning
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly

# Private readonly fields with underscore
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
dotnet_naming_rule.private_members_with_underscore.severity = warning

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

# Prefix style
dotnet_naming_style.prefix_underscore.capitalization = camel_case
dotnet_naming_style.prefix_underscore.required_prefix = _

# Constants are PascalCase
dotnet_naming_rule.local_constants_rule.severity = warning
dotnet_naming_rule.local_constants_rule.style = pascal_case_style
dotnet_naming_rule.local_constants_rule.symbols = local_constants_symbols

dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field
dotnet_naming_symbols.private_constants_symbols.required_modifiers = const

dotnet_naming_rule.private_constants_rule.severity = warning
dotnet_naming_rule.private_constants_rule.style = pascal_case_style
dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols

dotnet_naming_symbols.local_constants_symbols.applicable_accessibilities = *
dotnet_naming_symbols.local_constants_symbols.applicable_kinds = local
dotnet_naming_symbols.local_constants_symbols.required_modifiers = const

# Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = warning
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style

dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local

# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = warning
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.local_functions.applicable_kinds = local_function

# Test methods are underscore tolerant
dotnet_naming_rule.test_methods_should_be_underscore_tolerant.severity = warning
dotnet_naming_rule.test_methods_should_be_underscore_tolerant.symbols = test_methods
dotnet_naming_rule.test_methods_should_be_underscore_tolerant.style = test_methods_style

dotnet_naming_symbols.test_methods.applicable_accessibilities = local, public
dotnet_naming_symbols.test_methods.applicable_kinds =
dotnet_naming_symbols.test_methods.resharper_applicable_kinds = test_member
dotnet_naming_symbols.test_methods.resharper_required_modifiers = instance

dotnet_naming_style.test_methods_style.capitalization = pascal_case
dotnet_naming_style.test_methods_style.word_separator = _

dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# Microsoft .NET properties
csharp_preferred_modifier_order = public, protected, internal, private, new, abstract, virtual, override, sealed, static, readonly, extern, unsafe, volatile, async:suggestion
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion

# Parentheses settings
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none

# Newline settings
csharp_new_line_before_open_brace = all
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 = true
csharp_new_line_between_query_expression_clauses = true

resharper_csharp_new_line_before_while = true

# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_constructors = when_on_single_line:suggestion
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion

resharper_csharp_keep_existing_expr_member_arrangement = true
resharper_csharp_place_expr_method_on_single_line = if_owner_is_single_line
resharper_csharp_place_expr_property_on_single_line = if_owner_is_single_line

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion

resharper_local_function_body = expression_body
resharper_method_or_operator_body = expression_body

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion

# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

# Blocks are allowed
csharp_prefer_braces = true:silent
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_style_namespace_declarations = file_scoped

resharper_csharp_braces_for_for = required
resharper_csharp_braces_for_foreach = required
resharper_csharp_braces_for_while = required
resharper_csharp_braces_for_ifelse = required_for_multiline_statement
resharper_csharp_space_within_single_line_array_initializer_braces = true

# Alignment
resharper_csharp_align_linq_query = true
resharper_csharp_align_multiline_binary_expressions_chain = false
resharper_csharp_keep_blank_lines_in_code = 1
resharper_csharp_keep_blank_lines_in_declarations = 1
resharper_csharp_stick_comment = false
resharper_csharp_wrap_before_first_type_parameter_constraint = true
resharper_csharp_wrap_lines = false
resharper_csharp_wrap_multiple_type_parameter_constraints_style = chop_always
resharper_csharp_wrap_linq_expressions = chop_always
resharper_csharp_wrap_array_initializer_style = chop_if_long
resharper_csharp_place_constructor_initializer_on_same_line = false
resharper_csharp_place_accessorholder_attribute_on_same_line = false
resharper_csharp_place_field_attribute_on_same_line = false
resharper_csharp_place_simple_embedded_statement_on_same_line = false
resharper_wrap_before_arrow_with_expressions = true
resharper_csharp_wrap_before_arrow_with_expressions = true

# Arrangement of method signatures
resharper_csharp_wrap_parameters_style = chop_if_long
resharper_csharp_max_formal_parameters_on_line = 3
resharper_csharp_wrap_after_declaration_lpar = true

# Arrangement of invocations
resharper_csharp_wrap_arguments_style = chop_if_long
resharper_csharp_max_invocation_arguments_on_line = 3
resharper_csharp_wrap_after_invocation_lpar = true

# Arguments
resharper_csharp_arguments_literal = named

# Comments
resharper_xmldoc_indent_child_elements = RemoveIndent
resharper_xmldoc_indent_text = RemoveIndent
resharper_xmldoc_space_before_self_closing = false
resharper_xmldoc_max_line_length = 150

# Other
resharper_event_handler_pattern_long = $object$_On$event$
resharper_empty_statement_highlighting = suggestion
resharper_csharp_trailing_comma_in_multiline_lists = true
125 changes: 125 additions & 0 deletions .github/workflows/nuget_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: publish nuget
on:
workflow_dispatch:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
release:
types:
- published

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{github.workspace}}/nuget
DOTNET_TARGET_VERSION: 8.0.x
BUILD_NUMBER: ${{ github.run_number }}

defaults:
run:
shell: pwsh

jobs:
create_nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_TARGET_VERSION }}


# Create the NuGet package in the folder from the environment variable NuGetDirectory
- name: Build packages
run: dotnet pack --property:ContinuousIntegrationBuild=true --version-suffix ".${{ env.BUILD_NUMBER }}-dev" --configuration Release --output ${{ env.NuGetDirectory }}
if: github.event_name != 'release'

# Create the NuGet package in the folder from the environment variable NuGetDirectory
- name: Build packages
run: dotnet pack --property:ContinuousIntegrationBuild=true --version-suffix "-beta" --configuration Release --output ${{ env.NuGetDirectory }}
if: github.event_name == 'release'

# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: |
${{ env.NuGetDirectory }}/*.nupkg
${{ env.NuGetDirectory }}/*.snupkg

validate_nuget:
runs-on: ubuntu-latest
needs: [ create_nuget ]
steps:
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_TARGET_VERSION }}

# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}

- name: Install nuget validator
run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global

# Validate metadata and content of the NuGet package
# https://www.nuget.org/packages/Meziantou.Framework.NuGetPackageValidation.Tool#readme-body-tab
# If some rules are not applicable, you can disable them
# using the --excluded-rules or --excluded-rule-ids option
- name: Validate package
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg") --excluded-rules LicenseMustBeSet


run_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_TARGET_VERSION }}
- name: Run tests
run: dotnet test --configuration Release

deploy:
# Publish only when creating a GitHub Release
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
# You can update this logic if you want to manage releases differently
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [ validate_nuget, run_test ]
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}

# Install the .NET SDK indicated in the global.json file
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_TARGET_VERSION }}

# Publish all NuGet packages to NuGet.org
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_API_TOKEN }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
Loading
Loading