diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8eb3430 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,211 @@ +# editorconfig.org + +# top-most EditorConfig file +root = true + +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation +[*] +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +# Specify UTF-8 without byte-order mark +[*.{csproj,locproj,nativeproj,proj,resx,slnx,vbproj}] +charset = utf-8 + +# Generated code +[*{_AssemblyInfo.cs,.notsupported.cs,AsmOffsets.cs}] +generated_code = true + +# C# files +[*.cs] +# New line preferences +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 = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current + +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion + +# avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# Types: use keywords instead of BCL types, and permit var only when the type is clear +csharp_style_var_for_built_in_types = false:suggestion +csharp_style_var_when_type_is_apparent = false:none +csharp_style_var_elsewhere = false:suggestion +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +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_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_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 +dotnet_naming_style.static_prefix_style.required_prefix = s_ +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_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 = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +# Code style defaults +csharp_using_directive_placement = outside_namespace:suggestion +dotnet_sort_system_directives_first = true +csharp_prefer_braces = true:silent +csharp_preserve_single_line_blocks = true:none +csharp_preserve_single_line_statements = false:none +csharp_prefer_static_local_function = true:suggestion +csharp_prefer_simple_using_statement = false:none +csharp_style_prefer_switch_expression = true:suggestion +dotnet_style_readonly_field = true:suggestion + +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_collection_expression = when_types_exactly_match +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +csharp_prefer_simple_default_expression = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = true:silent +csharp_style_expression_bodied_constructors = true:silent +csharp_style_expression_bodied_operators = true: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 = true:silent + +# Pattern matching +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 + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Other features +csharp_style_prefer_index_operator = false:none +csharp_style_prefer_range_operator = false:none +csharp_style_pattern_local_over_anonymous_function = false:none + +# IDE0071: Simplify interpolation - keep as silent hint since ReadOnlySpan.ToString() is required for netstandard targets +dotnet_diagnostic.IDE0071.severity = silent + +# IDE0031: Use null propagation - keep as silent hint to avoid build errors with TreatWarningsAsErrors +dotnet_diagnostic.IDE0031.severity = silent + +# 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 + +# 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. + +# xUnit1051: recommends TestContext.Current.CancellationToken (v3 pattern) which +# is not yet adopted; suppress until a full v3 migration is performed. +dotnet_diagnostic.xUnit1051.severity = none + +[src/libraries/System.Net.Http/src/System/Net/Http/{SocketsHttpHandler/Http3RequestStream.cs,BrowserHttpHandler/BrowserHttpHandler.cs}] +# disable CA2025, the analyzer throws a NullReferenceException when processing this file: https://github.com/dotnet/roslyn-analyzers/issues/7652 +dotnet_diagnostic.CA2025.severity = none + +# C++ Files +[*.{cpp,h,in}] +curly_bracket_next_line = true +indent_brace_style = Allman + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] +indent_size = 2 + +# Xml build files +[*.builds] +indent_size = 2 + +# Xml files +[*.{resx,ruleset,slnx,stylecop,xml}] +indent_size = 2 + +# Xml resource files +[*.resx] +# match Visual Studio behavior +insert_final_newline = false +trim_trailing_whitespace = false + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +# Data serialization +[*.{json,yaml,yml}] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf +[*.{cmd,bat}] +end_of_line = crlf diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1637c49..78854c9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,6 +6,6 @@ updates: interval: daily time: "06:00" open-pull-requests-limit: 10 -ignore: - - dependency-name: "xunit.runner.visualstudio" - update-types: ["version-update:semver-minor"] + #ignore: + # - dependency-name: "xunit.runner.visualstudio" + # update-types: ["version-update:semver-minor"] diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 9ad3446..01221ba 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -11,27 +11,27 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: ['net60', 'net80', 'net90'] + framework: ['net8.0', 'net9.0', 'net10.0'] steps: - name: Check out code onto host - uses: actions/checkout@v6 - - - name: Setup .Net 6.0 - uses: actions/setup-dotnet@v5 - with: - dotnet-version: '6.0.x' # SDK Version to use. + uses: actions/checkout@v7 - name: Setup .Net 8.0 - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@v6 with: dotnet-version: '8.0.x' # SDK Version to use. - name: Setup .Net 9.0 - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@v6 with: dotnet-version: '9.0.x' # SDK Version to use. + - name: Setup .Net 10.0 + uses: actions/setup-dotnet@v6 + with: + dotnet-version: '10.0.x' # SDK Version to use. + - name: Dotnet info run: | dotnet --version @@ -55,18 +55,18 @@ jobs: - name: Run Benchmarks run: | dotnet run --no-restore --configuration Release --verbosity normal --framework=${{ matrix.framework }} --project ./tests/CSRakowski.Parallel.Benchmarks/ - if: matrix.framework == 'net80' + if: matrix.framework == 'net10.0' - name: Upload dotnet test results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: dotnet-results-${{ matrix.os }}-${{ matrix.framework }} path: TestResults-${{ matrix.os }}-${{ matrix.framework }} # Use always() to always run this step to publish test results when there are test failures if: ${{ always() }} - + - name: Upload BenchmarkDotNet results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: BenchmarkDotNet-${{ matrix.os }}-${{ matrix.framework }} path: BenchmarkDotNet.Artifacts @@ -84,13 +84,13 @@ jobs: steps: - name: Check out code onto host - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 - name: Setup .Net 8.0 - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@v6 with: dotnet-version: '8.0.x' # SDK Version to use. @@ -114,7 +114,7 @@ jobs: dotnet test --no-restore --configuration Release --verbosity normal --framework=${{ matrix.framework }} --logger trx --results-directory "TestResults-${{ matrix.os }}-${{ matrix.framework }}" - name: Upload dotnet test results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: dotnet-results-windows-latest-${{ matrix.framework }} path: TestResults-windows-latest-${{ matrix.framework }} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..24c7b46 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "jakubkozera.csharp-dev-tools", + "shd101wyy.markdown-preview-enhanced", + "k--kato.docomment" + ] +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..845b067 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,160 @@ +# Contributing to ParallelAsync + +Thank you for your interest in contributing to ParallelAsync! This document provides guidelines and information to help you contribute effectively. + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Development Environment](#development-environment) +- [How to Contribute](#how-to-contribute) +- [Pull Request Process](#pull-request-process) +- [Coding Standards](#coding-standards) +- [Testing Requirements](#testing-requirements) +- [Communication](#communication) +- [License](#license) + +## Code of Conduct + +We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful and professional in all interactions. + +## Getting Started + +1. Fork the repository on GitHub +2. Clone your fork locally +3. Set up your development environment (see below) +4. Create a new branch for your changes +5. Make your changes and commit them +6. Push to your fork and submit a pull request + +## Development Environment + +### Prerequisites + +- **.NET 10 SDK** - Required for building the project +- **Visual Studio 2026** (recommended) - Provides the best development experience +- **Visual Studio Code** with C# extensions (alternative) - Also supported for development + +### Setup + +```bash +# Clone your fork +git clone https://github.com/YOUR-USERNAME/ParallelAsync.git +cd ParallelAsync + +# Restore dependencies +dotnet restore + +# Build the solution +dotnet build + +# Run tests +dotnet test +``` + +## How to Contribute + +### Reporting Bugs + +- Use the GitHub [issue templates](.github/ISSUE_TEMPLATE.md) provided +- Include a clear description of the issue +- Provide steps to reproduce the problem +- Include any relevant error messages or logs + +### Suggesting Enhancements + +- Use the GitHub [issue templates](.github/ISSUE_TEMPLATE.md) provided +- Clearly describe the enhancement and its benefits +- Explain why this enhancement would be useful to most users + +### Submitting Changes + +**For significant work:** +- Always create an issue first to discuss the proposed changes +- Reference the issue number in your commits and pull request + +**For minor changes (typos, dependency bumps, etc.):** +- You may submit a pull request directly with a clear description + +## Pull Request Process + +1. **Target Branch**: Always target the `master` branch with your pull requests + +2. **Before Submitting**: + - Ensure all tests pass locally + - Add tests for new features or bug fixes + - Add benchmarks when applicable (for performance-related changes) + - Follow the project's coding standards (see below) + - Update documentation if needed + +3. **PR Description**: + - Provide a clear description of the changes + - Reference related issues using `#issue-number` + - Explain the reasoning behind the changes + - Describe any breaking changes + +4. **Review Process**: + - Address any feedback from maintainers + - Keep your branch up to date with master if needed + - Be patient - reviews may take some time + +5. **Merge Strategy**: This project uses merge commits to maintain a clear history + +## Coding Standards + +### C# Conventions + +- Follow a slightly updated flavor of the **Microsoft C# Coding Conventions** +- The project includes an `.editorconfig` file that helps enforce these standards +- Ensure your IDE respects the `.editorconfig` settings +- In case you feel you have a valid reason to deviate, please justify in the related PR/comments + +### General Guidelines + +- Write clear, self-documenting code +- Use meaningful variable and method names +- Add XML documentation comments for public APIs +- Keep methods focused and concise +- Avoid unnecessary complexity + +## Testing Requirements + +### Required for All Contributions + +- **All existing tests must pass** - No exceptions +- **New features must include tests** - Demonstrate functionality and prevent regressions +- **Bug fixes should include tests** - Prevent the issue from reoccurring +- **Benchmarks when applicable** - Add benchmarks for performance-sensitive features + +### Running Tests + +```bash +# Run all tests +dotnet test + +# Run tests with verbose output +dotnet test --logger "console;verbosity=detailed" +``` + +### Running Benchmarks + +```bash +# Navigate to the benchmark project and run +dotnet run -c Release --project tests/CSRakowski.Parallel.Benchmarks +``` + +## Communication + +- **Questions and Discussions**: Use GitHub Issues +- **Bug Reports**: Use GitHub Issues with the appropriate template +- **Feature Requests**: Use GitHub Issues with the appropriate template + +Please keep all project-related communication in GitHub Issues to maintain transparency and allow others to benefit from the discussion. + +## License + +By submitting code to this project, you acknowledge that your contributions will be licensed under the same license as the project (see [LICENSE](LICENSE) file). You confirm that you have the right to submit the code and agree to the project's license terms. + +--- + +Thank you for contributing to ParallelAsync! Your efforts help make this library better for everyone. diff --git a/CSRakowski.ParallelAsync.sln b/CSRakowski.ParallelAsync.sln index afa2e83..c56920e 100644 --- a/CSRakowski.ParallelAsync.sln +++ b/CSRakowski.ParallelAsync.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.32407.343 +# Visual Studio Version 18 +VisualStudioVersion = 18.8.12021.73 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSRakowski.Parallel", "src\CSRakowski.Parallel\CSRakowski.Parallel.csproj", "{A7EAE71C-5122-41D5-81CE-8CD626F861AF}" EndProject diff --git a/Directory.Build.props b/Directory.Build.props index 2da10ef..1890235 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,8 @@ Christiaan Rakowski - Christiaan Rakowski - 2017-2025 - 1.8.0 + Christiaan Rakowski - 2017-2026 + 1.8.1 latest @@ -30,6 +30,6 @@ - + diff --git a/LICENSE b/LICENSE index b89b8de..befc127 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2025 Christiaan Rakowski +Copyright (c) 2017-2026 Christiaan Rakowski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 89769c7..0db4484 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,9 @@ await foreach (var result in resultStream) # Release notes +### 1.8.1 +* Dropped support for .NET 6.0 + ### 1.8.0 * Updated TargetFrameworks to remove old unsupported ones. diff --git a/global.json b/global.json index 3a93eb1..2ab2ea3 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - //"version": "9.0.300", + //"version": "10.0.302", "rollForward": "latestFeature" } -} \ No newline at end of file +} diff --git a/src/CSRakowski.Parallel/CSRakowski.Parallel.csproj b/src/CSRakowski.Parallel/CSRakowski.Parallel.csproj index 2e35a7e..5c89d61 100644 --- a/src/CSRakowski.Parallel/CSRakowski.Parallel.csproj +++ b/src/CSRakowski.Parallel/CSRakowski.Parallel.csproj @@ -1,7 +1,7 @@  - net80;net472;netstandard2.0 + net10.0;net8.0;net472;netstandard2.0 true CSRakowski.ParallelAsync @@ -15,7 +15,7 @@ Parallel, Async, Batching true CSRakowski.Parallel.snk - * Updated TargetFrameworks to remove old unsupported ones. + * Dropped support for .NET 6.0 CSRakowski.Parallel CSRakowski.Parallel diff --git a/tests/CSRakowski.Parallel.Benchmarks/CSRakowski.Parallel.Benchmarks.csproj b/tests/CSRakowski.Parallel.Benchmarks/CSRakowski.Parallel.Benchmarks.csproj index 341281d..e97b21a 100644 --- a/tests/CSRakowski.Parallel.Benchmarks/CSRakowski.Parallel.Benchmarks.csproj +++ b/tests/CSRakowski.Parallel.Benchmarks/CSRakowski.Parallel.Benchmarks.csproj @@ -1,7 +1,7 @@ - net48;net472;net90;net80;net60; + net48;net472;net10.0;net9.0;net8.0 Exe false @@ -10,12 +10,12 @@ - + - + diff --git a/tests/CSRakowski.Parallel.Tests/CSRakowski.Parallel.Tests.csproj b/tests/CSRakowski.Parallel.Tests/CSRakowski.Parallel.Tests.csproj index 3d48967..281b82c 100644 --- a/tests/CSRakowski.Parallel.Tests/CSRakowski.Parallel.Tests.csproj +++ b/tests/CSRakowski.Parallel.Tests/CSRakowski.Parallel.Tests.csproj @@ -1,7 +1,7 @@  - net48;net472;net90;net80;net60 + net48;net472;net10.0;net9.0;net8.0 false true @@ -11,25 +11,19 @@ + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - - diff --git a/tests/Profiling/App.config b/tests/Profiling/App.config index 741b8de..53bd35b 100644 --- a/tests/Profiling/App.config +++ b/tests/Profiling/App.config @@ -15,7 +15,7 @@ - + diff --git a/tests/Profiling/Profiling.csproj b/tests/Profiling/Profiling.csproj index f77ecda..e9e5c26 100644 --- a/tests/Profiling/Profiling.csproj +++ b/tests/Profiling/Profiling.csproj @@ -62,7 +62,7 @@ 1.6.0 - 7.0.0 + 10.0.10 6.1.2