Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
141 changes: 141 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
[*]
indent_style = space
csharp_indent_labels = one_less_than_current
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = file_scoped:warning
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_methods = false: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
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_prefer_simple_default_expression = 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_prefer_unbound_generic_type_in_nameof = 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_style_prefer_switch_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
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
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent
csharp_style_var_elsewhere = false:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
csharp_prefer_system_threading_lock = true:suggestion
csharp_style_prefer_readonly_struct_member = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_prefer_static_anonymous_function = true:suggestion
csharp_prefer_static_local_function = true:suggestion
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_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = lf
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:warning
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:warning
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_code_quality_unused_parameters = all:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_readonly_field = true:suggestion
dotnet_diagnostic.IDE0005.severity = error
dotnet_diagnostic.CS1591.severity = none

[src/**/*.cs]
dotnet_diagnostic.CS1591.severity = error
40 changes: 40 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
* text=auto

# Source
*.cs text eol=lf
*.csx text eol=lf

# Project files
*.csproj text eol=lf
*.props text eol=lf
*.targets text eol=lf
*.sln text eol=crlf
*.slnx text eol=lf

# Config / docs
*.json text eol=lf
*.jsonc text eol=lf
*.xml text eol=lf
*.config text eol=lf
*.editorconfig text eol=lf
*.gitattributes text eol=lf
*.gitignore text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf

# Scripts
*.ps1 text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.sh text eol=lf

# Binary assets
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.pdf binary
*.zip binary
*.dll binary
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches: [ main ]
pull_request:

permissions:
contents: read
packages: write

jobs:
format:
uses: PANiXiDA-Infrastructure/ci-cd/.github/workflows/dotnet-format.yml@main
secrets:
registry-user: ${{ secrets.REGISTRY_USER }}
registry-token: ${{ secrets.REGISTRY_TOKEN }}

tests:
uses: PANiXiDA-Infrastructure/ci-cd/.github/workflows/dotnet-tests.yml@main
secrets:
registry-user: ${{ secrets.REGISTRY_USER }}
registry-token: ${{ secrets.REGISTRY_TOKEN }}

publish:
needs:
- format
- tests
uses: PANiXiDA-Infrastructure/ci-cd/.github/workflows/dotnet-publish-global-nuget.yml@main
secrets:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

notify:
if: ${{ always() && github.event_name != 'pull_request' }}
needs: [ publish ]
uses: PANiXiDA-Infrastructure/ci-cd/.github/workflows/notify-telegram.yml@main
with:
event-name: ${{ github.event_name }}
secrets:
telegram-bot-token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
telegram-chat-id: ${{ vars.TELEGRAM_CHAT_ID }}
github-token: ${{ secrets.REGISTRY_TOKEN }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.suo
*.user
[Bb]in/
[Oo]bj/
.vs/
.idea
TestResults/
91 changes: 91 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# AGENTS.md

## Purpose

This repository is a reference template for PANiXiDA .NET NuGet packages.
The goal is to keep package structure, CI, versioning, tests, documentation, and release flow consistent across repositories.

## Repository layout

- `src/` — package source code
- `tests/` — automated tests
- `README.md` — package overview and usage examples
- `Directory.Build.props` — shared build settings
- `Directory.Packages.props` — centralized package versions
- `version.json` — Nerdbank.GitVersioning configuration
- `ci.yml` — CI pipeline

## Technology baseline

- .NET 10
- Nullable enabled
- Implicit usings enabled
- Central package management enabled
- Microsoft Testing Platform
- xUnit v3
- FluentAssertions
- Nerdbank.GitVersioning

## Coding rules

- Preserve existing naming.
- Do not introduce expression-bodied method declarations.
- Prefer explicit, readable code over short clever code.
- Public APIs must include XML documentation written in English.
- Avoid breaking public API changes unless explicitly requested.
- Do not weaken nullability annotations.
- Do not silently change exception behavior.

## Library design rules

- Keep public API small and intentional.
- Favor immutability for public models.
- Validate all public method arguments.
- Prefer deterministic behavior and stable error messages.
- Do not add dependencies without a strong reason.

## Tests

- Add or update tests for every meaningful behavior change.
- Cover happy path, guard clauses, and failure scenarios.
- Verify public API behavior, not implementation details, unless required.
- When fixing a bug, add a regression test first.
- Do not add `using Xunit;` or `using FluentAssertions;` in test files, because they are provided as global usings in the test project.
- Write `DisplayName` values in English.
- Structure tests using the Arrange, Act, Assert pattern.

## Documentation

- Update `README.md` when public behavior, public API, package metadata, or development workflow changes.
- Keep the README structure aligned with the repository standard.
- Keep installation instructions, target framework, badges, and package information accurate.
- Keep all examples compilable and aligned with the current API.
- Ensure usage examples reflect real and recommended library usage.
- Remove outdated or duplicate documentation when updating existing sections.

## Build and validation

Before considering work complete, run:

- `dotnet restore`
- `dotnet format`
- `dotnet build --configuration Release`
- `dotnet test --configuration Release`

## Packaging and versioning

- Package metadata must stay complete and consistent.
- README and icon must be included in the package.
- Changes affecting package contents must be reflected in versioning inputs.
- Do not change package id, repository url, or license without explicit request.

## Definition of done

A change is done only when:

- code is formatted,
- code builds,
- tests pass,
- relevant tests were added or updated,
- README was updated if public behavior changed,
- no unnecessary files or dependencies were introduced.
16 changes: 16 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisLevel>latest</AnalysisLevel>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
</Project>
Loading
Loading