Skip to content

Commit 1212f63

Browse files
authored
Merge pull request #81 from rprouse/copilot
Add development guidelines for .NET Todo application
2 parents ae2c43a + dc08ad9 commit 1212f63

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed

.github/copilot-instructions.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# .NET Todo Application - Development Guidelines
2+
3+
## Purpose of the Application
4+
The .NET Todo application is a command-line utility inspired by the Todo.txt shell script. It provides a robust and extensible way to manage tasks using a plain text file. The application aims to remain faithful to the original Todo.txt functionality while leveraging modern .NET features.
5+
6+
## Coding Style
7+
- **Language**: C#
8+
- **Framework**: .NET Core
9+
- **Conventions**: The project adheres to standard C# coding conventions, including PascalCase for public members and camelCase for private members.
10+
- **Dependency Injection**: The application uses Microsoft.Extensions.DependencyInjection for managing dependencies.
11+
- **Async/Await**: Asynchronous programming is used extensively for I/O-bound operations.
12+
- **Command Pattern**: Commands and queries are implemented using the MediatR library.
13+
14+
## Architecture
15+
The application follows a modular clean architecture with the following layers:
16+
17+
1. **Domain Layer** (`todo.domain`):
18+
- Contains core entities like `TaskItem` and interfaces such as `ITaskFile` and `ITaskConfiguration`.
19+
- Implements business logic and rules.
20+
21+
2. **Application Layer** (`todo.application`):
22+
- Implements commands and queries using the MediatR library.
23+
- Provides handlers for operations like adding, deleting, and listing tasks.
24+
25+
3. **Infrastructure Layer** (`todo.infrastructure`):
26+
- Handles persistence and configuration management.
27+
- Implements interfaces defined in the domain layer.
28+
29+
4. **Presentation Layer** (`todo`):
30+
- Contains the `TodoApplication` class, which serves as the entry point.
31+
- Implements CLI commands using `System.CommandLine`.
32+
33+
## NuGet Packages Used
34+
- **MediatR**: Implements the mediator pattern for handling commands and queries.
35+
- **System.CommandLine**: Provides a framework for building command-line applications.
36+
- **ColoredConsole**: Adds colorized output to the console.
37+
- **NUnit**: Used for unit testing.
38+
- **FluentAssertions**: Provides a fluent syntax for writing assertions in tests.
39+
40+
## Testing Style
41+
- **Framework**: NUnit
42+
- **Mocking**: Custom mocks (e.g., `TaskFileMock`) are used to simulate dependencies.
43+
- **Structure**: Tests are organized by layer and feature (e.g., `Commands`, `Queries`).
44+
- **Assertions**: FluentAssertions is used for readable and expressive assertions.
45+
- **Setup**: Common setup logic is placed in `[SetUp]` methods.
46+
47+
## CI/CD Workflow
48+
The project includes a GitHub Actions workflow (`.github/workflows/dotnet-core.yml`) that:
49+
- Restores dependencies.
50+
- Builds the project in Release mode.
51+
- Runs unit tests.
52+
- Packages the application as a NuGet package.
53+
- Publishes the package to GitHub Packages and NuGet.org.

.github/workflows/dotnet-core.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: 📥 Checkout Code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717

1818
- name: 💉 Install dependencies
1919
run: dotnet restore
@@ -28,7 +28,7 @@ jobs:
2828
run: dotnet pack --no-build --configuration Release src/todo/todo.csproj
2929

3030
- name: 📤 Upload Artifacts
31-
uses: actions/upload-artifact@v3
31+
uses: actions/upload-artifact@v4
3232
with:
3333
name: nupkg
3434
path: src/todo/nupkg/*.nupkg
@@ -41,7 +41,7 @@ jobs:
4141
if: github.ref == 'refs/heads/main'
4242
steps:
4343
- name: 📥 Download Artifacts
44-
uses: actions/download-artifact@v3
44+
uses: actions/download-artifact@v4
4545
with:
4646
name: nupkg
4747

0 commit comments

Comments
 (0)