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
174 changes: 174 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# All files
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

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

# JSON files
[*.json]
indent_size = 2

# YAML files
[*.{yml,yaml}]
indent_size = 2

# Shell scripts
[*.sh]
end_of_line = lf

# Markdown files
[*.md]
trim_trailing_whitespace = false

# Dotnet code style settings:
[*.{cs,vb}]

# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# CSharp code style settings:
[*.cs]

# 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 = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none

# 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

# 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

# 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 = 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

# 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

# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

# Naming conventions
[*.{cs,vb}]

# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
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 = warning
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 = warning
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.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.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
48 changes: 45 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
# Visual Studio and IDEs
.vs
*.bak
node_modules
.vscode
.idea
*.user
*.suo
*.userosscache
*.sln.docstates

# Build results
bin/
obj/
TestResults/
[Dd]ebug/
[Rr]elease/
x64/
x86/
[Aa]rm/
[Aa]rm64/
bld/
[Bb]in/
[Oo]bj/
drop/

# Test results
TestResults/
[Tt]est[Rr]esult*/
*.trx
*.coverage
*.coveragexml

# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Backup files
*.bak
*~
*.swp

# OS files
.DS_Store
Thumbs.db

# NuGet
*.nupkg
*.snupkg
.nuget/
69 changes: 64 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,53 @@ applications packaged as [.NET Tools][dotnet-tools].

```text
DotnetToolWrapper/
├── .config/
│ └── dotnet-tools.json # .NET tools configuration (sbom-tool, spdx-tool)
├── .github/
│ ├── ISSUE_TEMPLATE/ # GitHub issue templates
│ │ ├── bug_report.yml
│ │ ├── feature_request.yml
│ │ └── config.yml
│ ├── dependabot.yml # Dependabot configuration
│ └── workflows/ # GitHub Actions workflows
│ ├── build.yaml # Reusable build workflow
│ ├── build_on_push.yaml # Triggered on push events
│ └── release.yaml # Release workflow
├── docs/
│ └── usage.md # Detailed usage documentation
├── src/
│ └── DemaConsulting.DotnetToolWrapper/
│ ├── Program.cs # Main application logic
│ └── DemaConsulting.DotnetToolWrapper.csproj
├── test/
│ └── DemaConsulting.DotnetToolWrapper.Tests/
│ ├── IntegrationTests.cs
│ ├── ProgramTests.cs
│ ├── Runner.cs
│ └── DemaConsulting.DotnetToolWrapper.Tests.csproj
├── .cspell.json # Spelling check configuration
├── .editorconfig # Editor configuration for consistent formatting
├── .gitignore # Git ignore patterns
├── .markdownlint.json # Markdown linting configuration
├── README.md # Project documentation
├── AGENTS.md # This file - Agent instructions
├── ARCHITECTURE.md # Architecture documentation
├── CODE_OF_CONDUCT.md # Community code of conduct
├── CONTRIBUTING.md # Contribution guidelines
├── DemaConsulting.DotnetToolWrapper.sln
├── LICENSE # MIT License
├── README.md # Project documentation
├── SECURITY.md # Security policy
└── spdx-workflow.yaml # SBOM enhancement workflow
```

## Key Technologies

- **.NET 8.0, 9.0, 10.0**: Multi-targeted framework versions
- **C# 12**: Programming language
- **MSTest**: Testing framework
- **GitHub Actions**: CI/CD automation
- **SBOM Tools**: Software Bill of Materials generation
- **SBOM Tools**: Software Bill of Materials generation (sbom-tool, spdx-tool)
- **Code Analyzers**: Microsoft.CodeAnalysis.NetAnalyzers 10.0.101, SonarAnalyzer.CSharp 10.17.0.131074

## Development Guidelines

Expand All @@ -43,12 +68,29 @@ dotnet restore
dotnet build --configuration Release
```

### Testing the Project

```bash
# Run all tests
dotnet test --configuration Release

# Run tests with detailed output
dotnet test --configuration Release --logger "console;verbosity=detailed"
```

The test project uses MSTest and includes:

- **Unit Tests**: `ProgramTests.cs` - Tests for core program logic
- **Integration Tests**: `IntegrationTests.cs` - End-to-end tests with actual execution
- **Test Runner**: `Runner.cs` - Helper for running the tool in tests

### Code Standards

- **Language Version**: C# 12
- **Nullable Reference Types**: Enabled
- **Implicit Usings**: Enabled
- **Target Frameworks**: net8.0, net9.0, net10.0
- **EditorConfig**: Follow the .editorconfig rules for consistent code formatting

### Workflow Structure

Expand All @@ -72,6 +114,11 @@ Quality checks are automated through GitHub Actions:
1. **Multi-targeting**: Always ensure changes are compatible with .NET 8.0, 9.0, and 10.0
2. **Cross-platform**: The tool must work on Windows, Linux, FreeBSD, and macOS
3. **Architecture Support**: Support x86, x64, ARM, ARM64, WASM, and S390x architectures
4. **Testing**: Always run tests after making changes. The CI runs tests on ubuntu-latest,
windows-latest, and macos-latest
5. **Code Quality**: Maintain `TreatWarningsAsErrors` - all warnings must be fixed
6. **Analyzers**: Keep analyzer packages (Microsoft.CodeAnalysis.NetAnalyzers and
SonarAnalyzer.CSharp) at the same version across all projects

### When Modifying Workflows

Expand All @@ -98,7 +145,9 @@ Quality checks are automated through GitHub Actions:

### Adding New Dependencies

Update the `.csproj` file in `src/DemaConsulting.DotnetToolWrapper/`
1. Update the `.csproj` file in `src/DemaConsulting.DotnetToolWrapper/`
2. If adding analyzer packages, ensure test project also gets the same version
3. Dependabot is configured to automatically update NuGet packages in the `nuget-dependencies` group

### Modifying Build Output

Expand All @@ -115,8 +164,17 @@ Edit the "Create Drop Folder" step in `.github/workflows/build.yaml`
Before committing:

1. Build locally: `dotnet build --configuration Release`
2. Run spelling checks: `npx cspell "**/*.md"`
3. Run markdown linting: `npx markdownlint "**/*.md"`
2. Run tests: `dotnet test --configuration Release`
3. Run spelling checks: `npx cspell "**/*.md"`
4. Run markdown linting: `npx markdownlint "**/*.md"`

## Issue Templates

The repository includes structured issue templates:

- **Bug Report** (`.github/ISSUE_TEMPLATE/bug_report.yml`) - For reporting bugs with system information
- **Feature Request** (`.github/ISSUE_TEMPLATE/feature_request.yml`) - For suggesting new features
- **Config** (`.github/ISSUE_TEMPLATE/config.yml`) - Links to discussions and other resources

## Related Documentation

Expand All @@ -125,6 +183,7 @@ Before committing:
- [CONTRIBUTING.md](CONTRIBUTING.md) - Contribution guidelines and development setup
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) - Community code of conduct
- [SECURITY.md](SECURITY.md) - Security policy and vulnerability reporting
- [docs/usage.md](docs/usage.md) - Comprehensive usage guide with examples
- [LICENSE](LICENSE) - MIT License terms

## Contact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.101">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.4.0.108396">
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.17.0.131074">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down