Skip to content

Commit

Permalink
Merge branch 'steps/10-commands' into steps/11-avoid-exceptions
Browse files Browse the repository at this point in the history
# Conflicts:
#	c#/Bouchonnois.Tests/LangExtExtensions.cs
#	c#/Bouchonnois/Domain/Error.cs
#	c#/Bouchonnois/Domain/Exceptions/ChasseurInconnu.cs
#	c#/Bouchonnois/Domain/Exceptions/ImpossibleDeDémarrerUnePartieAvecUnChasseurSansBalle.cs
#	c#/Bouchonnois/Domain/Exceptions/ImpossibleDeDémarrerUnePartieSansChasseur.cs
#	c#/Bouchonnois/Domain/Exceptions/ImpossibleDeDémarrerUnePartieSansGalinettes.cs
#	c#/Bouchonnois/Domain/Exceptions/LaChasseEstDéjàEnCours.cs
#	c#/Bouchonnois/Domain/Exceptions/OnEstDéjàEnTrainDePrendreLapéro.cs
#	c#/Bouchonnois/Domain/Exceptions/OnPrendPasLapéroQuandLaPartieEstTerminée.cs
#	c#/Bouchonnois/Domain/Exceptions/OnTirePasPendantLapéroCestSacré.cs
#	c#/Bouchonnois/Domain/Exceptions/OnTirePasQuandLaPartieEstTerminée.cs
#	c#/Bouchonnois/Domain/Exceptions/QuandCestFiniCestFini.cs
#	c#/Bouchonnois/Domain/Exceptions/TasPlusDeBallesMonVieuxChasseALaMain.cs
#	c#/Bouchonnois/Domain/Exceptions/TasTropPicoléMonVieuxTasRienTouché.cs
#	c#/Bouchonnois/UseCases/Exceptions/LaPartieDeChasseNexistePas.cs
#	c#/Bouchonnois/UseCases/FunctionalExtensions.cs
  • Loading branch information
ythirion committed Jun 14, 2024
2 parents 897fe53 + 45a9362 commit 5be0d4a
Show file tree
Hide file tree
Showing 136 changed files with 4,252 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml → .github/workflows/c#.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: SonarCloud
name: C# CI
on:
push:
branches:
Expand All @@ -20,11 +20,11 @@ jobs:
name: Build and analyze
runs-on: windows-latest
steps:
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu' # Alternative distribution options are available.
java-version: 17
distribution: 'zulu'
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
Expand Down Expand Up @@ -55,6 +55,6 @@ jobs:
run: |
dotnet tool install --global dotnet-coverage
.\.sonar\scanner\dotnet-sonarscanner begin /k:"ythirion_refactoring-du-bouchonnois" /o:"ythirion" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
dotnet build
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
dotnet build c#/
dotnet-coverage collect "dotnet test c#/" -f xml -o "coverage.xml"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
34 changes: 34 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Java CI
on:
push:
branches:
- main
- steps/01-gather-metrics
- steps/02-treat-warnings-as-errors
- steps/03-kill-mutants
- steps/04-improve-tests-readability
- steps/05-approve-everything
- steps/06-properties
- steps/07-architecture-tests
- steps/08-use-cases
- steps/09-tell-dont-ask
- steps/10-commands
- steps/11-avoid-exceptions
- steps/12-event-sourcing
jobs:
build:
name: Build
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
- name: Build and Test
working-directory: ./java
run: mvn test
36 changes: 36 additions & 0 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Kotlin CI
on:
push:
branches:
- main
- steps/01-gather-metrics
- steps/02-treat-warnings-as-errors
- steps/03-kill-mutants
- steps/04-improve-tests-readability
- steps/05-approve-everything
- steps/06-properties
- steps/07-architecture-tests
- steps/08-use-cases
- steps/09-tell-dont-ask
- steps/10-commands
- steps/11-avoid-exceptions
- steps/12-event-sourcing
jobs:
build:
name: Build
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
build-root-directory: ./kotlin
63 changes: 62 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,66 @@ target/
# Mac
.DS_Store

target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# Verify
*.received.txt
*.received.txt
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ Version PDF disponible [ici](example-mapping/example-mapping.pdf)

## Facilitation
### Pré-requis
Le code est disponible en `.NET 7`.
Le code est disponible en `C#` (`.NET 7`), `java`(21), `kotlin`.

Voici la liste des packages utilisés :
- `xUnit`
- `FluentAssertions`
- `Verify.xUnit`
- `FSCheck`
- `TngTech.ArchUnitNET.xUnit`
- `LanguageExt.Core`
- `FluentAssertions.LanguageExt`
Voici la liste des librairies utilisés / recommandées :

| .NET | Java | Kotlin |
|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| [`xUnit`](https://xunit.net/) | [`junit`](https://junit.org/junit5/) | [`Kotest`](https://kotest.io/) |
| [`FluentAssertions`](https://fluentassertions.com/) | [`assertJ`](https://joel-costigliola.github.io/assertj/) | Native `kotest` asertions |
| [`Verify.xUnit`](https://github.com/VerifyTests/Verify) | [`approvalTests`](https://github.com/approvals/approvaltests.java) | [`approvalTests`](https://github.com/approvals/approvaltests.java) |
| [`FSCheck`](https://fscheck.github.io/FsCheck/) | [`vavr-test`](https://github.com/vavr-io/vavr-test) | [`kotest-property`](https://kotest.io/docs/proptest/property-based-testing.html) |
| [`TngTech.ArchUnitNET.xUnit`](https://archunitnet.readthedocs.io/en/latest/) | [`archunit`](https://www.archunit.org/) | [`archunit`](https://www.archunit.org/) |
| [`LanguageExt.Core`](https://github.com/louthy/language-ext) | [`vavr`](https://www.vavr.io/) | [`arrow-kt`](https://arrow-kt.io/) |
| [`FluentAssertions.LanguageExt`](https://www.nuget.org/packages/FluentAssertions.LanguageExt) | [`assertj-vavr`](https://github.com/assertj/assertj-vavr) | [`kotest-extensions-arrow`](https://github.com/kotest/kotest-extensions-arrow#kotest-extensions-arrow) |

Afin d'améliorer le code on te propose de suivre les étapes ci-dessous :

Expand All @@ -56,7 +59,7 @@ Afin d'améliorer le code on te propose de suivre les étapes ci-dessous :
- [12. Event Sourcing](facilitation/12.event-sourcing.md)

Pour chaque étape :
- une proposition de solution "étape par étape" est proposée
- une proposition de solution "étape par étape" est proposée (en `C#` uniquement)
- il existe 1 branche / étape

![Branches](img/branches.webp)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using LanguageExt;

namespace Bouchonnois.Tests.Unit;
namespace Bouchonnois.Tests;

public static class LangExtExtensions
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5be0d4a

Please sign in to comment.