From 63e755c5c79524077cb146568962b6260dd48b3f Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 31 Mar 2026 10:07:47 +0200 Subject: [PATCH 001/105] =?UTF-8?q?refactor:=20#150=20mettre=20=C3=A0=20jo?= =?UTF-8?q?ur=20appsettings=20et=20introduire=20des=20enums=20pour=20les?= =?UTF-8?q?=20types=20Seeder=20et=20Repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/pr-endpoint-check.yml | 16 ++----- .../Dockerfile => Dockerfile | 2 +- .../Configuration/AppEnums.cs | 13 ++++++ Webzine.WebApplication/Program.cs | 42 +++++++------------ .../appsettings.Development.json | 8 +--- .../appsettings.Production.json | 4 ++ Webzine.WebApplication/appsettings.json | 6 +-- 7 files changed, 39 insertions(+), 52 deletions(-) rename Webzine.WebApplication/Dockerfile => Dockerfile (88%) create mode 100644 Webzine.WebApplication/Configuration/AppEnums.cs create mode 100644 Webzine.WebApplication/appsettings.Production.json diff --git a/.gitea/workflows/pr-endpoint-check.yml b/.gitea/workflows/pr-endpoint-check.yml index 427f687..aadf030 100644 --- a/.gitea/workflows/pr-endpoint-check.yml +++ b/.gitea/workflows/pr-endpoint-check.yml @@ -11,20 +11,10 @@ jobs: - name: Checkout PR branch uses: actions/checkout@v4 - - name: Configure appsettings for CI + - name: Configure environment for CI run: | - # Find the appsettings.json file - APPSETTINGS_PATH="Webzine.WebApplication/appsettings.json" - - # Backup original file - cp $APPSETTINGS_PATH $APPSETTINGS_PATH.bak - - # Use jq to modify the JSON - jq '.UseDatabase = true | .IsSQLite = true' $APPSETTINGS_PATH > $APPSETTINGS_PATH.tmp - mv $APPSETTINGS_PATH.tmp $APPSETTINGS_PATH - - echo "Updated appsettings.json:" - cat $APPSETTINGS_PATH + echo "ASPNETCORE_ENVIRONMENT=Development" >> $ACT_ENV + echo "Repository=Db" >> $ACT_ENV - name: Setup .NET 10 uses: actions/setup-dotnet@v4 diff --git a/Webzine.WebApplication/Dockerfile b/Dockerfile similarity index 88% rename from Webzine.WebApplication/Dockerfile rename to Dockerfile index 3211249..bd375cc 100644 --- a/Webzine.WebApplication/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ EXPOSE 8081 FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src -COPY ["Webzine.WebApplication/Webzine.WebApplication.csproj", "Webzine.WebApplication/"] +COPY ["./Webzine.WebApplication/Webzine.WebApplication.csproj", "Webzine.WebApplication/"] RUN dotnet restore "Webzine.WebApplication/Webzine.WebApplication.csproj" COPY . . WORKDIR "/src/Webzine.WebApplication" diff --git a/Webzine.WebApplication/Configuration/AppEnums.cs b/Webzine.WebApplication/Configuration/AppEnums.cs new file mode 100644 index 0000000..93d4e8b --- /dev/null +++ b/Webzine.WebApplication/Configuration/AppEnums.cs @@ -0,0 +1,13 @@ +namespace Webzine.WebApplication.Configuration; + +public enum SeederType +{ + Local, + Spotify +} + +public enum RepositoryType +{ + Local, + Db +} \ No newline at end of file diff --git a/Webzine.WebApplication/Program.cs b/Webzine.WebApplication/Program.cs index ae26f07..1b763dc 100644 --- a/Webzine.WebApplication/Program.cs +++ b/Webzine.WebApplication/Program.cs @@ -8,6 +8,7 @@ using Webzine.Entity; using Webzine.Entity.Fixtures; using Webzine.Repository; using Webzine.Repository.Contracts; +using Webzine.WebApplication.Configuration; using Webzine.WebApplication.Extensions; // Initiation du logger NLog pour la classe courante afin de pouvoir l'utiliser pour logger des messages d'information, d'erreur, etc avant la construction de l'application. @@ -32,19 +33,19 @@ try builder.Host.UseNLog(); // En fonction de la configuration, utilise soit les repositories basés sur une base de données, soit les repositories basés sur des listes locales. - bool useDatabase = builder.Configuration.GetValue("UseDatabase"); - bool isSQLite = builder.Configuration.GetValue("IsSQLite"); - if (useDatabase) + var repositoryType = builder.Configuration.GetValue("Repository"); + var seederType = builder.Configuration.GetValue("Seeder"); + if (repositoryType == RepositoryType.Db) { - if (isSQLite) + if (builder.Environment.IsProduction()) { builder.Services.AddDbContext(options => - options.UseSqlite(builder.Configuration.GetConnectionString("SqliteConnection"))); + options.UseNpgsql(builder.Configuration.GetConnectionString("PostGreSQLConnection"))); } else { builder.Services.AddDbContext(options => - options.UseNpgsql(builder.Configuration.GetConnectionString("PostGreSQLConnection"))); + options.UseSqlite(builder.Configuration.GetConnectionString("SqliteConnection"))); } builder.Services.AddScoped(); @@ -68,30 +69,15 @@ try var app = builder.Build(); - if (useDatabase) + if (repositoryType == RepositoryType.Db) { - if (isSQLite) + using (var scope = app.Services.CreateScope()) { - using (var scope = app.Services.CreateScope()) - { - var db = scope.ServiceProvider.GetRequiredService(); - db.Database.EnsureDeleted(); - db.Database.EnsureCreated(); - var repo = scope.ServiceProvider.GetRequiredService(); - repo.SeedBaseDeDonnees(); - } - } - else - { - using (var scope = app.Services.CreateScope()) - { - // TODO : A modifier pour ne pas supprimer la base de donnée en prod - var db = scope.ServiceProvider.GetRequiredService(); - db.Database.EnsureDeleted(); - db.Database.EnsureCreated(); - var repo = scope.ServiceProvider.GetRequiredService(); - repo.SeedBaseDeDonnees(); - } + var db = scope.ServiceProvider.GetRequiredService(); + db.Database.EnsureDeleted(); + db.Database.EnsureCreated(); + var repo = scope.ServiceProvider.GetRequiredService(); + repo.SeedBaseDeDonnees(); } } else diff --git a/Webzine.WebApplication/appsettings.Development.json b/Webzine.WebApplication/appsettings.Development.json index 0c208ae..79222b7 100644 --- a/Webzine.WebApplication/appsettings.Development.json +++ b/Webzine.WebApplication/appsettings.Development.json @@ -1,8 +1,4 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } + "Seeder": "Local", + "Repository": "Db" } diff --git a/Webzine.WebApplication/appsettings.Production.json b/Webzine.WebApplication/appsettings.Production.json new file mode 100644 index 0000000..0609b7f --- /dev/null +++ b/Webzine.WebApplication/appsettings.Production.json @@ -0,0 +1,4 @@ +{ + "Seeder": "Local", + "Repository": "Db" +} \ No newline at end of file diff --git a/Webzine.WebApplication/appsettings.json b/Webzine.WebApplication/appsettings.json index fc87614..ac0f745 100644 --- a/Webzine.WebApplication/appsettings.json +++ b/Webzine.WebApplication/appsettings.json @@ -9,11 +9,9 @@ "NombreDerniereChronique": 3, "NombreDeTopTitres": 3 }, - "UseDatabase": true, - "IsSQLite": true, "ConnectionStrings": { "SqliteConnection": "Data Source=Data/webzine.sqlite", - "PostGreSQLConnection" : "Host=localhost;Port=5432;Username=admin;Password=admin123;Database=webzine_db" + "PostGreSQLConnection": "Host=192.168.60.50;Port=5432;Username=postgres;Password=BcS4e6DHr2NgVrnPomVI;Database=webzine_prod" }, "AllowedHosts": "*" -} +} \ No newline at end of file From 29f1fd97be59f1e2807cba211d337694bc095c1d Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 31 Mar 2026 10:08:08 +0200 Subject: [PATCH 002/105] =?UTF-8?q?refactor:=20mise=20=C3=A0=20jour=20la?= =?UTF-8?q?=20version=20de=20l'application=20=C3=A0=203.0=20dans=20ApiCont?= =?UTF-8?q?roller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Webzine.WebApplication/Controllers/ApiController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Webzine.WebApplication/Controllers/ApiController.cs b/Webzine.WebApplication/Controllers/ApiController.cs index 1b1beca..f01d7a1 100644 --- a/Webzine.WebApplication/Controllers/ApiController.cs +++ b/Webzine.WebApplication/Controllers/ApiController.cs @@ -29,7 +29,7 @@ public class ApiController : ControllerBase return this.Ok(new { nom = "webzine", - version = "2.0", + version = "3.0", }); } } \ No newline at end of file From aa4ad9ef8e4618eef86a040c4da66a592eac0995 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Tue, 31 Mar 2026 10:22:11 +0200 Subject: [PATCH 003/105] =?UTF-8?q?refactor:=20mise=20=C3=A0=20jour=20la?= =?UTF-8?q?=20configuration=20des=20variables=20d=E2=80=99environnement=20?= =?UTF-8?q?dans=20pr-endpoint-check.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/pr-endpoint-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/pr-endpoint-check.yml b/.gitea/workflows/pr-endpoint-check.yml index aadf030..e487e80 100644 --- a/.gitea/workflows/pr-endpoint-check.yml +++ b/.gitea/workflows/pr-endpoint-check.yml @@ -13,8 +13,8 @@ jobs: - name: Configure environment for CI run: | - echo "ASPNETCORE_ENVIRONMENT=Development" >> $ACT_ENV - echo "Repository=Db" >> $ACT_ENV + echo "ASPNETCORE_ENVIRONMENT=Development" >> "${GITHUB_ENV:-$ACT_ENV}" + echo "Repository=Db" >> "${GITHUB_ENV:-$ACT_ENV}" - name: Setup .NET 10 uses: actions/setup-dotnet@v4 From 8eaefe79034db67c590824bfabbc9fddbdde1d01 Mon Sep 17 00:00:00 2001 From: "josephine.vetu" Date: Tue, 31 Mar 2026 11:16:34 +0200 Subject: [PATCH 004/105] =?UTF-8?q?#144=20Ajout=20des=20fichiers=20commit-?= =?UTF-8?q?msg=20et=20pre-commit.=20Modification=20de=20.editorconfig=20po?= =?UTF-8?q?ur=20ajouter=20des=20r=C3=A8gles=20personnalis=C3=A9es.=20Exclu?= =?UTF-8?q?sion=20de=20Progam.cs=20pour=20l'erreur=20SA1200.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 500 +++++++++--------- .../equipe 1 - dossier de configuration.md | 68 ++- Webzine.Documentation/StyleCop/stylecop.json | 4 +- Webzine.Documentation/git_hooks/commit-msg | 24 + Webzine.Documentation/git_hooks/pre-commit | 21 + Webzine.Entity.Tests/.editorconfig | 2 + Webzine.Repository/DbArtisteRepository.cs | 2 - Webzine.Repository/DbStyleRepository.cs | 5 +- Webzine.Repository/DbTitreRepository.cs | 5 +- Webzine.Repository/LocalStyleRepository.cs | 5 +- Webzine.Repository/LocalTitreRepository.cs | 5 +- .../Controllers/ArtisteController.cs | 7 +- .../Controllers/DashboardController.cs | 6 +- .../Controllers/TitreController.cs | 5 +- .../ViewModels/Titre/AdminTitreForm.cs | 4 +- .../Controllers/ApiController.cs | 4 +- .../Extensions/RouteConfiguration.cs | 2 +- Webzine.WebApplication/Program.cs | 3 + .../Recherche/RechercheIndexViewModel.cs | 4 +- .../ViewModels/Titre/TitreComment.cs | 4 +- .../ViewModels/Titre/TitreContent.cs | 4 +- 21 files changed, 374 insertions(+), 310 deletions(-) create mode 100644 Webzine.Documentation/git_hooks/commit-msg create mode 100644 Webzine.Documentation/git_hooks/pre-commit create mode 100644 Webzine.Entity.Tests/.editorconfig diff --git a/.editorconfig b/.editorconfig index 9896049..19e562e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,64 +1,59 @@ root = true -# All files +# ============================================================ +# ALL FILES +# ============================================================ [*] indent_style = space -# Xml files +# ============================================================ +# XML FILES +# ============================================================ [*.xml] indent_size = 2 -# Xml project files [*.{csproj,fsproj,vbproj,proj,slnx}] indent_size = 2 -# Xml config files [*.{props,targets,config,nuspec}] indent_size = 2 +# ============================================================ +# JSON FILES +# ============================================================ [*.json] indent_size = 2 -# C# files -[*.cs] - -#### Core EditorConfig Options #### - -# Indentation and spacing -indent_size = 4 -tab_width = 4 - -# New line preferences -insert_final_newline = false - -#### .NET Coding Conventions #### +# ============================================================ +# C# AND VB FILES — SHARED .NET CONVENTIONS +# ============================================================ [*.{cs,vb}] -# Organize usings +#### Organize Usings #### dotnet_separate_import_directive_groups = true dotnet_sort_system_directives_first = true file_header_template = unset -# this. and Me. preferences +#### this. and Me. Preferences #### dotnet_style_qualification_for_event = false:silent dotnet_style_qualification_for_field = false:silent dotnet_style_qualification_for_method = false:silent dotnet_style_qualification_for_property = false:silent -# Language keywords vs BCL types preferences +#### Language Keywords vs BCL Types #### dotnet_style_predefined_type_for_locals_parameters_members = true:silent dotnet_style_predefined_type_for_member_access = true:silent -# Parentheses preferences +#### Parentheses Preferences #### dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent -# Modifier preferences +#### Modifier Preferences #### dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent -# Expression-level preferences +#### Expression-Level Preferences #### dotnet_style_coalesce_expression = true:suggestion dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion @@ -78,129 +73,30 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggesti dotnet_style_prefer_simplified_boolean_expressions = true:suggestion dotnet_style_prefer_simplified_interpolation = true:suggestion -# Field preferences +#### Field Preferences #### dotnet_style_readonly_field = true:warning -# Parameter preferences +#### Parameter Preferences #### dotnet_code_quality_unused_parameters = all:suggestion -# Suppression preferences +#### Suppression Preferences #### dotnet_remove_unnecessary_suppression_exclusions = none -#### C# Coding Conventions #### -[*.cs] +#### Diagnostics #### +dotnet_diagnostic.IDE0005.severity = warning # Remove unused usings +dotnet_diagnostic.IDE0073.severity = none # File header not required +dotnet_diagnostic.SA1600.severity = warning # Elements should be documented +dotnet_diagnostic.SA1623.severity = none # Property summary text +dotnet_diagnostic.SA1624.severity = none # Property summary text +dotnet_diagnostic.SA1633.severity = none # File header not required +dotnet_diagnostic.SA1642.severity = suggestion # Constructor summary text -# var preferences -csharp_style_var_elsewhere = false:silent -csharp_style_var_for_built_in_types = false:silent -csharp_style_var_when_type_is_apparent = false:silent - -# Expression-bodied members -csharp_style_expression_bodied_accessors = true:silent -csharp_style_expression_bodied_constructors = false:silent -csharp_style_expression_bodied_indexers = true:silent -csharp_style_expression_bodied_lambdas = true:suggestion -csharp_style_expression_bodied_local_functions = false:silent -csharp_style_expression_bodied_methods = false:silent -csharp_style_expression_bodied_operators = false:silent -csharp_style_expression_bodied_properties = true:silent - -# Pattern matching preferences -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion -csharp_style_prefer_extended_property_pattern = true:suggestion -csharp_style_prefer_not_pattern = true:suggestion -csharp_style_prefer_pattern_matching = true:silent -csharp_style_prefer_switch_expression = true:suggestion - -# Null-checking preferences -csharp_style_conditional_delegate_call = true:suggestion - -# Modifier preferences -csharp_prefer_static_anonymous_function = true:suggestion -csharp_prefer_static_local_function = true:warning -csharp_preferred_modifier_order = public,private,protected,internal,file,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion -csharp_style_prefer_readonly_struct = true:suggestion -csharp_style_prefer_readonly_struct_member = true:suggestion - -# Code-block preferences -csharp_prefer_braces = true:silent -csharp_prefer_simple_using_statement = true:suggestion -csharp_style_namespace_declarations = file_scoped:suggestion -csharp_style_prefer_method_group_conversion = true:silent -csharp_style_prefer_primary_constructors = true:suggestion -csharp_style_prefer_top_level_statements = true:silent - -# Expression-level preferences -csharp_prefer_simple_default_expression = true:suggestion -csharp_style_deconstructed_variable_declaration = true:suggestion -csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion -csharp_style_inlined_variable_declaration = true:suggestion -csharp_style_prefer_index_operator = true:suggestion -csharp_style_prefer_local_over_anonymous_function = true:suggestion -csharp_style_prefer_null_check_over_type_check = true:suggestion -csharp_style_prefer_range_operator = true:suggestion -csharp_style_prefer_tuple_swap = true:suggestion -csharp_style_prefer_utf8_string_literals = true:suggestion -csharp_style_throw_expression = true:suggestion -csharp_style_unused_value_assignment_preference = discard_variable:suggestion -csharp_style_unused_value_expression_statement_preference = discard_variable:silent - -# 'using' directive preferences -csharp_using_directive_placement = outside_namespace:silent - -#### C# Formatting Rules #### - -# New line preferences -csharp_new_line_before_catch = true -csharp_new_line_before_else = true -csharp_new_line_before_finally = true -csharp_new_line_before_members_in_anonymous_types = true -csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_open_brace = all -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 = true -csharp_indent_labels = one_less_than_current -csharp_indent_switch_labels = true - -# 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 styles #### +# ============================================================ +# NAMING RULES +# ============================================================ [*.{cs,vb}] -# Naming rules - +## Rules ## dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase @@ -225,6 +121,38 @@ dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion dotnet_naming_rule.events_should_be_pascalcase.symbols = events dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase +dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields +dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion +dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields +dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase + +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase + +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums +dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase + dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase @@ -237,38 +165,6 @@ dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase -dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields -dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion -dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields -dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase - -dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion -dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields -dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase - -dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields -dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields -dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields -dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields -dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase - -dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion -dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums -dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase - dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase @@ -277,67 +173,35 @@ dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase -# Symbol specifications +## Symbol Specifications ## +dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum +dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types_and_namespaces.required_modifiers = dotnet_naming_symbols.interfaces.applicable_kinds = interface dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interfaces.required_modifiers = +dotnet_naming_symbols.interfaces.required_modifiers = -dotnet_naming_symbols.enums.applicable_kinds = enum -dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.enums.required_modifiers = - -dotnet_naming_symbols.events.applicable_kinds = event -dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.events.required_modifiers = +# NOTE: was previously misconfigured as 'namespace' kind — corrected to 'type_parameter' +dotnet_naming_symbols.type_parameters.applicable_kinds = type_parameter +dotnet_naming_symbols.type_parameters.applicable_accessibilities = * +dotnet_naming_symbols.type_parameters.required_modifiers = dotnet_naming_symbols.methods.applicable_kinds = method dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.methods.required_modifiers = +dotnet_naming_symbols.methods.required_modifiers = dotnet_naming_symbols.properties.applicable_kinds = property dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.properties.required_modifiers = +dotnet_naming_symbols.properties.required_modifiers = + +dotnet_naming_symbols.events.applicable_kinds = event +dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.events.required_modifiers = dotnet_naming_symbols.public_fields.applicable_kinds = field dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal -dotnet_naming_symbols.public_fields.required_modifiers = - -dotnet_naming_symbols.private_fields.applicable_kinds = field -dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected -dotnet_naming_symbols.private_fields.required_modifiers = - -dotnet_naming_symbols.private_static_fields.applicable_kinds = field -dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected -dotnet_naming_symbols.private_static_fields.required_modifiers = static - -dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum -dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types_and_namespaces.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 = - -dotnet_naming_symbols.type_parameters.applicable_kinds = namespace -dotnet_naming_symbols.type_parameters.applicable_accessibilities = * -dotnet_naming_symbols.type_parameters.required_modifiers = - -dotnet_naming_symbols.private_constant_fields.applicable_kinds = field -dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected -dotnet_naming_symbols.private_constant_fields.required_modifiers = const - -dotnet_naming_symbols.local_variables.applicable_kinds = local -dotnet_naming_symbols.local_variables.applicable_accessibilities = local -dotnet_naming_symbols.local_variables.required_modifiers = - -dotnet_naming_symbols.local_constants.applicable_kinds = local -dotnet_naming_symbols.local_constants.applicable_accessibilities = local -dotnet_naming_symbols.local_constants.required_modifiers = const - -dotnet_naming_symbols.parameters.applicable_kinds = parameter -dotnet_naming_symbols.parameters.applicable_accessibilities = * -dotnet_naming_symbols.parameters.required_modifiers = +dotnet_naming_symbols.public_fields.required_modifiers = dotnet_naming_symbols.public_constant_fields.applicable_kinds = field dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal @@ -347,57 +211,193 @@ dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_fields.required_modifiers = + +dotnet_naming_symbols.private_static_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_fields.required_modifiers = static + +dotnet_naming_symbols.private_constant_fields.applicable_kinds = field +dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_constant_fields.required_modifiers = const + dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static +dotnet_naming_symbols.enums.applicable_kinds = enum +dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.enums.required_modifiers = + +dotnet_naming_symbols.local_variables.applicable_kinds = local +dotnet_naming_symbols.local_variables.applicable_accessibilities = local +dotnet_naming_symbols.local_variables.required_modifiers = + +dotnet_naming_symbols.local_constants.applicable_kinds = local +dotnet_naming_symbols.local_constants.applicable_accessibilities = local +dotnet_naming_symbols.local_constants.required_modifiers = const + +dotnet_naming_symbols.parameters.applicable_kinds = parameter +dotnet_naming_symbols.parameters.applicable_accessibilities = * +dotnet_naming_symbols.parameters.required_modifiers = + dotnet_naming_symbols.local_functions.applicable_kinds = local_function dotnet_naming_symbols.local_functions.applicable_accessibilities = * -dotnet_naming_symbols.local_functions.required_modifiers = +dotnet_naming_symbols.local_functions.required_modifiers = -# Naming styles +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 = -dotnet_naming_style.pascalcase.required_prefix = -dotnet_naming_style.pascalcase.required_suffix = -dotnet_naming_style.pascalcase.word_separator = +## Naming Styles ## dotnet_naming_style.pascalcase.capitalization = pascal_case +dotnet_naming_style.pascalcase.required_prefix = +dotnet_naming_style.pascalcase.required_suffix = +dotnet_naming_style.pascalcase.word_separator = -dotnet_naming_style.ipascalcase.required_prefix = I -dotnet_naming_style.ipascalcase.required_suffix = -dotnet_naming_style.ipascalcase.word_separator = dotnet_naming_style.ipascalcase.capitalization = pascal_case +dotnet_naming_style.ipascalcase.required_prefix = I +dotnet_naming_style.ipascalcase.required_suffix = +dotnet_naming_style.ipascalcase.word_separator = -dotnet_naming_style.tpascalcase.required_prefix = T -dotnet_naming_style.tpascalcase.required_suffix = -dotnet_naming_style.tpascalcase.word_separator = dotnet_naming_style.tpascalcase.capitalization = pascal_case +dotnet_naming_style.tpascalcase.required_prefix = T +dotnet_naming_style.tpascalcase.required_suffix = +dotnet_naming_style.tpascalcase.word_separator = -dotnet_naming_style._camelcase.required_prefix = _ -dotnet_naming_style._camelcase.required_suffix = -dotnet_naming_style._camelcase.word_separator = -dotnet_naming_style._camelcase.capitalization = camel_case - -dotnet_naming_style.camelcase.required_prefix = -dotnet_naming_style.camelcase.required_suffix = -dotnet_naming_style.camelcase.word_separator = dotnet_naming_style.camelcase.capitalization = camel_case +dotnet_naming_style.camelcase.required_prefix = +dotnet_naming_style.camelcase.required_suffix = +dotnet_naming_style.camelcase.word_separator = + +dotnet_naming_style._camelcase.capitalization = camel_case +dotnet_naming_style._camelcase.required_prefix = _ +dotnet_naming_style._camelcase.required_suffix = +dotnet_naming_style._camelcase.word_separator = -dotnet_naming_style.s_camelcase.required_prefix = s_ -dotnet_naming_style.s_camelcase.required_suffix = -dotnet_naming_style.s_camelcase.word_separator = dotnet_naming_style.s_camelcase.capitalization = camel_case +dotnet_naming_style.s_camelcase.required_prefix = s_ +dotnet_naming_style.s_camelcase.required_suffix = +dotnet_naming_style.s_camelcase.word_separator = -dotnet_diagnostic.SA1623.severity = none -dotnet_diagnostic.SA1624.severity = none - -dotnet_diagnostic.SA1600.severity = suggestion - +# ============================================================ +# C# FILES ONLY +# ============================================================ [*.cs] -# 1. Tell the .NET Formatter to stop injecting a header -file_header_template = unset -# 2. Tell StyleCop to stop requiring a file header (SA1633) -dotnet_diagnostic.SA1633.severity = none +#### Core EditorConfig Options #### +indent_size = 4 +tab_width = 4 +insert_final_newline = false -# 3. Tell the IDE to stop requiring a file header (IDE0073) -dotnet_diagnostic.IDE0073.severity = none \ No newline at end of file +#### var Preferences #### +csharp_style_var_elsewhere = false:silent +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent + +#### Expression-Bodied Members #### +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:suggestion +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent + +#### Pattern Matching Preferences #### +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_extended_property_pattern = true:suggestion +csharp_style_prefer_not_pattern = true:suggestion +csharp_style_prefer_pattern_matching = true:silent +csharp_style_prefer_switch_expression = true:suggestion + +#### Null-Checking Preferences #### +csharp_style_conditional_delegate_call = true:suggestion + +#### Modifier Preferences #### +csharp_prefer_static_anonymous_function = true:suggestion +csharp_prefer_static_local_function = true:warning +csharp_preferred_modifier_order = public,private,protected,internal,file,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion +csharp_style_prefer_readonly_struct = true:suggestion +csharp_style_prefer_readonly_struct_member = true:suggestion + +#### Code-Block Preferences #### +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_style_namespace_declarations = file_scoped:suggestion +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_prefer_top_level_statements = true:silent + +#### Expression-Level Preferences #### +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_local_over_anonymous_function = true:suggestion +csharp_style_prefer_null_check_over_type_check = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_prefer_tuple_swap = true:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent + +#### Using Directive Preferences #### +csharp_using_directive_placement = inside_namespace:warning + +#### Formatting — New Line Preferences #### +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +#### Formatting — Indentation Preferences #### +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +#### Formatting — 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 + +#### Formatting — Wrapping Preferences #### +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +# ============================================================ +# TEST PROJECTS — RELAXED RULES +# ============================================================ +[*.Tests/**/*.cs] +dotnet_diagnostic.SA1600.severity = none \ No newline at end of file diff --git a/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md b/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md index 9d202cb..d99576d 100644 --- a/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md +++ b/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md @@ -8,8 +8,8 @@ ## Table des modifications -| Date | Auteur | -|------|--------| +| Date | Auteur | +| ----- | ------------- | | 25/03 | Clément Bobin | --- @@ -18,12 +18,12 @@ Avant de lancer l'application, assurez-vous d'avoir installé les outils suivants : -| Outil | Version minimale | Lien | -|-------|-----------------|------| -| .NET SDK | 10.0 | https://dotnet.microsoft.com/download | -| Node.js (optionnel, pour outils front) | 18+ | https://nodejs.org | -| Git | 2.x | https://git-scm.com | -| Un IDE | Visual Studio 2022+ ou Rider | — | +| Outil | Version minimale | Lien | +| -------------------------------------- | ---------------------------- | ------------------------------------- | +| .NET SDK | 10.0 | https://dotnet.microsoft.com/download | +| Node.js (optionnel, pour outils front) | 18+ | https://nodejs.org | +| Git | 2.x | https://git-scm.com | +| Un IDE | Visual Studio 2022+ ou Rider | — | --- @@ -65,6 +65,7 @@ dotnet run ``` L'application est accessible par défaut à : + - **HTTP :** http://localhost:5038 - **HTTPS :** https://localhost:7095 @@ -89,10 +90,10 @@ Le fichier principal de configuration est `Webzine.WebApplication/appsettings.js } ``` -| Propriété | Type | Description | Valeur par défaut | -|-----------|------|-------------|-------------------| -| `NombreDerniereChronique` | int | Nombre de chroniques affichées sur la page d'accueil (section "Derniers titres") | 3 | -| `NombreDeTopTitres` | int | Nombre de titres affichés dans le bloc "Titres les plus populaires" | 3 | +| Propriété | Type | Description | Valeur par défaut | +| ------------------------- | ---- | -------------------------------------------------------------------------------- | ----------------- | +| `NombreDerniereChronique` | int | Nombre de chroniques affichées sur la page d'accueil (section "Derniers titres") | 3 | +| `NombreDeTopTitres` | int | Nombre de titres affichés dans le bloc "Titres les plus populaires" | 3 | Ces valeurs sont injectées dans `AccueilController` via `IConfiguration` et peuvent être modifiées sans recompilation. @@ -106,14 +107,15 @@ La configuration du logging se trouve dans `Webzine.WebApplication/nlog.config`. Les logs sont écrits dans le dossier `/Logs/` avec deux fichiers : -| Fichier | Contenu | -|---------|---------| +| Fichier | Contenu | +| --------------------- | ----------------------------------------------------- | | `nlog-all-{date}.log` | Tous les logs (Debug et supérieur pour l'application) | -| `nlog-own-{date}.log` | Logs applicatifs avec URL de la requête | +| `nlog-own-{date}.log` | Logs applicatifs avec URL de la requête | Les logs de la console sont également activés, utiles lors du développement. **Niveaux configurés :** + - `Webzine.WebApplication.*` → Debug et supérieur - `Microsoft.*` → Warning et supérieur (pour réduire le bruit) - `Microsoft.Hosting.Lifetime*` → Info (pour voir le démarrage de l'appli) @@ -143,18 +145,18 @@ Les tests vérifient les contraintes de validation (annotations DataAnnotations) ## 8. Routes principales -| URL | Contrôleur | Description | -|-----|-----------|-------------| -| `/` | `AccueilController.Index` | Page d'accueil | -| `/artiste/{nom}` | `ArtisteController.Index` | Page d'un artiste | -| `/titre/{id}` | `TitreController.Details` | Détail d'un titre | -| `/titre/style/{style}` | `TitreController.Style` | Titres par style | -| `/recherche` (POST) | `RechercheController.Index` | Résultats de recherche | -| `/Administration/Dashboard` | `DashboardController.Index` | Tableau de bord admin | -| `/Administration/Artiste` | `ArtisteController` (admin) | Gestion des artistes | -| `/Administration/Titre` | `TitreController` (admin) | Gestion des titres | -| `/Administration/Style` | `StyleController` | Gestion des styles | -| `/Administration/Commentaire` | `CommentaireController` | Gestion des commentaires | +| URL | Contrôleur | Description | +| ----------------------------- | --------------------------- | ------------------------ | +| `/` | `AccueilController.Index` | Page d'accueil | +| `/artiste/{nom}` | `ArtisteController.Index` | Page d'un artiste | +| `/titre/{id}` | `TitreController.Details` | Détail d'un titre | +| `/titre/style/{style}` | `TitreController.Style` | Titres par style | +| `/recherche` (POST) | `RechercheController.Index` | Résultats de recherche | +| `/Administration/Dashboard` | `DashboardController.Index` | Tableau de bord admin | +| `/Administration/Artiste` | `ArtisteController` (admin) | Gestion des artistes | +| `/Administration/Titre` | `TitreController` (admin) | Gestion des titres | +| `/Administration/Style` | `StyleController` | Gestion des styles | +| `/Administration/Commentaire` | `CommentaireController` | Gestion des commentaires | --- @@ -168,4 +170,14 @@ En production, positionner : export ASPNETCORE_ENVIRONMENT=Production ``` -Cela désactive les pages d'erreur détaillées et active les optimisations de performance ASP.NET Core. \ No newline at end of file +Cela désactive les pages d'erreur détaillées et active les optimisations de performance ASP.NET Core. + +## Ajout du pre-commit + +Les fichiers présents dans le dossier git_hooks sont à copier dans le dossier caché .git. +Le pre-commit reformatte le code à chaque commit. +Le commit-msg vérifie si le message du commit respecte bien les conventions du cahier des charges: + +- le message référence un ticket +- le message termine par un point +- le message doit faire au moins 10 caractères diff --git a/Webzine.Documentation/StyleCop/stylecop.json b/Webzine.Documentation/StyleCop/stylecop.json index b387567..c2b8c42 100644 --- a/Webzine.Documentation/StyleCop/stylecop.json +++ b/Webzine.Documentation/StyleCop/stylecop.json @@ -2,9 +2,7 @@ "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", "settings": { "documentationRules": { - "documentInterfaces": false, - "documentInternalElements": false, - "documentExposedElements": false + "documentationCulture": "fr-FR" }, "maintainabilityRules": { "settings": { diff --git a/Webzine.Documentation/git_hooks/commit-msg b/Webzine.Documentation/git_hooks/commit-msg new file mode 100644 index 0000000..eb15525 --- /dev/null +++ b/Webzine.Documentation/git_hooks/commit-msg @@ -0,0 +1,24 @@ +#!/bin/sh + +# Hook: commit-msg +# Validates the commit message format. +# Git passes the path to the temp message file as $1. + +COMMIT_MSG=$(cat "$1") + +if [ ${#COMMIT_MSG} -le 10 ]; then + echo "❌ Erreur : Le message doit faire plus de 10 caractères." + exit 1 +fi + +if ! echo "$COMMIT_MSG" | grep -q "\.$"; then + echo "❌ Erreur : Le commit doit se terminer par un point." + exit 1 +fi + +if ! echo "$COMMIT_MSG" | grep -q "#[0-9]\+"; then + echo "❌ Erreur : Vous devez faire référence à un ticket (ex: #123)." + exit 1 +fi + +exit 0 diff --git a/Webzine.Documentation/git_hooks/pre-commit b/Webzine.Documentation/git_hooks/pre-commit new file mode 100644 index 0000000..5473d88 --- /dev/null +++ b/Webzine.Documentation/git_hooks/pre-commit @@ -0,0 +1,21 @@ +#!/bin/sh + +# Hook: pre-commit +# Runs dotnet format on staged files, then verifies documentation warnings. + +echo "🔧 Running dotnet format..." +dotnet format --severity warn +if [ $? -ne 0 ]; then + echo "❌ Erreur : dotnet format a échoué." + exit 1 +fi +git add -u + +echo "📄 Vérification de la documentation..." +dotnet format style --severity warn --verify-no-changes +if [ $? -ne 0 ]; then + echo "❌ Erreur : Documentation manquante (classes/méthodes non commentées)." + exit 1 +fi + +exit 0 diff --git a/Webzine.Entity.Tests/.editorconfig b/Webzine.Entity.Tests/.editorconfig new file mode 100644 index 0000000..c148d4b --- /dev/null +++ b/Webzine.Entity.Tests/.editorconfig @@ -0,0 +1,2 @@ +[*.cs] +dotnet_diagnostic.SA1600.severity = none \ No newline at end of file diff --git a/Webzine.Repository/DbArtisteRepository.cs b/Webzine.Repository/DbArtisteRepository.cs index 404f7bf..800f5af 100644 --- a/Webzine.Repository/DbArtisteRepository.cs +++ b/Webzine.Repository/DbArtisteRepository.cs @@ -4,8 +4,6 @@ namespace Webzine.Repository { - using System.Data.Common; - using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; diff --git a/Webzine.Repository/DbStyleRepository.cs b/Webzine.Repository/DbStyleRepository.cs index 6d8350b..c350a4f 100644 --- a/Webzine.Repository/DbStyleRepository.cs +++ b/Webzine.Repository/DbStyleRepository.cs @@ -1,11 +1,12 @@ +namespace Webzine.Repository; + using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; + using Webzine.EntitiesContext; using Webzine.Entity; using Webzine.Repository.Contracts; -namespace Webzine.Repository; - /// /// Classe qui implémente le repository pour les styles en utilisant une base de données. /// diff --git a/Webzine.Repository/DbTitreRepository.cs b/Webzine.Repository/DbTitreRepository.cs index 20b90fd..9c0ac04 100644 --- a/Webzine.Repository/DbTitreRepository.cs +++ b/Webzine.Repository/DbTitreRepository.cs @@ -1,11 +1,12 @@ +namespace Webzine.Repository; + using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; + using Webzine.EntitiesContext; using Webzine.Entity; using Webzine.Repository.Contracts; -namespace Webzine.Repository; - /// /// Classe qui implémente le repository pour les titres en utilisant une base de données. /// diff --git a/Webzine.Repository/LocalStyleRepository.cs b/Webzine.Repository/LocalStyleRepository.cs index 02a033d..0b4d16c 100644 --- a/Webzine.Repository/LocalStyleRepository.cs +++ b/Webzine.Repository/LocalStyleRepository.cs @@ -1,9 +1,10 @@ +namespace Webzine.Repository; + using Microsoft.Extensions.Logging; + using Webzine.Entity; using Webzine.Repository.Contracts; -namespace Webzine.Repository; - /// /// Classe qui implémente le repository pour les styles en utilisant une liste locale comme source de données. /// diff --git a/Webzine.Repository/LocalTitreRepository.cs b/Webzine.Repository/LocalTitreRepository.cs index 741bbc8..ff8832c 100644 --- a/Webzine.Repository/LocalTitreRepository.cs +++ b/Webzine.Repository/LocalTitreRepository.cs @@ -1,9 +1,10 @@ +namespace Webzine.Repository; + using Microsoft.Extensions.Logging; + using Webzine.Entity; using Webzine.Repository.Contracts; -namespace Webzine.Repository; - /// /// Classe qui implémente le repository pour les titres en utilisant une liste locale comme source de données. /// diff --git a/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs b/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs index d9e2436..fcaf920 100644 --- a/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs +++ b/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs @@ -1,10 +1,11 @@ -using Microsoft.AspNetCore.Mvc; +namespace Webzine.WebApplication.Areas.Administration.Controllers; + +using Microsoft.AspNetCore.Mvc; + using Webzine.Entity; using Webzine.Repository.Contracts; using Webzine.WebApplication.Areas.Administration.ViewModels.Artiste; -namespace Webzine.WebApplication.Areas.Administration.Controllers; - /// /// Contrôleur pour la gestion des artistes dans l'administration du webzine. /// diff --git a/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs b/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs index e8e3d89..2f314ad 100644 --- a/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs +++ b/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs @@ -1,10 +1,10 @@ -using System.Diagnostics; +namespace Webzine.WebApplication.Areas.Administration.Controllers; + using Microsoft.AspNetCore.Mvc; + using Webzine.Repository.Contracts; using Webzine.WebApplication.Areas.Administration.ViewModels; -namespace Webzine.WebApplication.Areas.Administration.Controllers; - [Area("Administration")] public class DashboardController : Controller { diff --git a/Webzine.WebApplication/Areas/Administration/Controllers/TitreController.cs b/Webzine.WebApplication/Areas/Administration/Controllers/TitreController.cs index 59f88f0..f703fec 100644 --- a/Webzine.WebApplication/Areas/Administration/Controllers/TitreController.cs +++ b/Webzine.WebApplication/Areas/Administration/Controllers/TitreController.cs @@ -1,11 +1,12 @@ +namespace Webzine.WebApplication.Areas.Administration.Controllers; + using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; + using Webzine.Entity; using Webzine.Repository.Contracts; using Webzine.WebApplication.Areas.Administration.ViewModels.Titre; -namespace Webzine.WebApplication.Areas.Administration.Controllers; - /// /// Contrôleur pour la gestion des titres en administration. Ce contrôleur gère les opérations de création, modification, suppression et affichage des titres dans l'interface d'administration du webzine. Chaque action du contrôleur prépare un ViewModel spécifique pour la vue correspondante, permettant ainsi une séparation claire entre la logique métier et la présentation des données. /// diff --git a/Webzine.WebApplication/Areas/Administration/ViewModels/Titre/AdminTitreForm.cs b/Webzine.WebApplication/Areas/Administration/ViewModels/Titre/AdminTitreForm.cs index 420bf39..5305732 100644 --- a/Webzine.WebApplication/Areas/Administration/ViewModels/Titre/AdminTitreForm.cs +++ b/Webzine.WebApplication/Areas/Administration/ViewModels/Titre/AdminTitreForm.cs @@ -1,7 +1,7 @@ -using Microsoft.AspNetCore.Mvc.Rendering; - namespace Webzine.WebApplication.Areas.Administration.ViewModels.Titre; +using Microsoft.AspNetCore.Mvc.Rendering; + /// /// ViewModel pour la création et la modification d'un titre dans l'administration. /// diff --git a/Webzine.WebApplication/Controllers/ApiController.cs b/Webzine.WebApplication/Controllers/ApiController.cs index 1b1beca..42f72bb 100644 --- a/Webzine.WebApplication/Controllers/ApiController.cs +++ b/Webzine.WebApplication/Controllers/ApiController.cs @@ -1,7 +1,7 @@ -using Microsoft.AspNetCore.Mvc; - namespace Webzine.WebApplication.Controllers; +using Microsoft.AspNetCore.Mvc; + public class ApiController : ControllerBase { private readonly ILogger logger; diff --git a/Webzine.WebApplication/Extensions/RouteConfiguration.cs b/Webzine.WebApplication/Extensions/RouteConfiguration.cs index a3df301..caa0efa 100644 --- a/Webzine.WebApplication/Extensions/RouteConfiguration.cs +++ b/Webzine.WebApplication/Extensions/RouteConfiguration.cs @@ -15,4 +15,4 @@ public static class RouteConfiguration name: "default", pattern: "{controller=Accueil}/{action=Index}/{id?}"); } -} +} \ No newline at end of file diff --git a/Webzine.WebApplication/Program.cs b/Webzine.WebApplication/Program.cs index ae26f07..2a19bd7 100644 --- a/Webzine.WebApplication/Program.cs +++ b/Webzine.WebApplication/Program.cs @@ -1,3 +1,6 @@ +// L'erreur SA1200 (ordre des using directives) est desactivée pour Program.cs +#pragma warning disable SA1200 + using Microsoft.EntityFrameworkCore; using NLog; diff --git a/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs b/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs index 177125d..1d7b246 100644 --- a/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs +++ b/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs @@ -1,7 +1,7 @@ -using Webzine.WebApplication.ViewModels.Titre; - namespace Webzine.WebApplication.ViewModels.Recherche; +using Webzine.WebApplication.ViewModels.Titre; + /// /// ViewModel pour afficher les resultats de recherche d'artistes et de titres. /// diff --git a/Webzine.WebApplication/ViewModels/Titre/TitreComment.cs b/Webzine.WebApplication/ViewModels/Titre/TitreComment.cs index 1281c77..e2bedc7 100644 --- a/Webzine.WebApplication/ViewModels/Titre/TitreComment.cs +++ b/Webzine.WebApplication/ViewModels/Titre/TitreComment.cs @@ -1,7 +1,7 @@ -using System.ComponentModel.DataAnnotations; - namespace Webzine.WebApplication.ViewModels.Titre; +using System.ComponentModel.DataAnnotations; + /// /// Classe représentant un commentaire sur un titre, utilisée pour la validation des données lors de la soumission d'un commentaire. /// diff --git a/Webzine.WebApplication/ViewModels/Titre/TitreContent.cs b/Webzine.WebApplication/ViewModels/Titre/TitreContent.cs index 43d46a1..52d561e 100644 --- a/Webzine.WebApplication/ViewModels/Titre/TitreContent.cs +++ b/Webzine.WebApplication/ViewModels/Titre/TitreContent.cs @@ -1,7 +1,7 @@ -using Webzine.Entity; - namespace Webzine.WebApplication.ViewModels.Titre; +using Webzine.Entity; + /// /// Contient les détails d'un titre, ainsi que les commentaires associés. /// From 6f009fcc3d8bcbb415eec2d2f3642ff46efd0eea Mon Sep 17 00:00:00 2001 From: Loic Masi Date: Tue, 31 Mar 2026 13:06:30 +0200 Subject: [PATCH 005/105] =?UTF-8?q?#154=20:=20Premi=C3=A8re=20optimisation?= =?UTF-8?q?=20de=20la=20recherche?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Webzine.Repository/DbArtisteRepository.cs | 2 +- Webzine.Repository/DbTitreRepository.cs | 1 + .../Controllers/RechercheController.cs | 40 ++------ .../Recherche/RechercheIndexViewModel.cs | 36 +++---- .../Views/Recherche/Index.cshtml | 93 +++++++++---------- wwwroot/css/site.css | 0 6 files changed, 72 insertions(+), 100 deletions(-) delete mode 100644 wwwroot/css/site.css diff --git a/Webzine.Repository/DbArtisteRepository.cs b/Webzine.Repository/DbArtisteRepository.cs index 404f7bf..2546bc7 100644 --- a/Webzine.Repository/DbArtisteRepository.cs +++ b/Webzine.Repository/DbArtisteRepository.cs @@ -120,7 +120,7 @@ namespace Webzine.Repository try { // .AsNoTracking() rend la requête beaucoup plus rapide pour de la lecture - var artistes = this.context.Artistes.AsNoTracking().ToList(); + var artistes = this.context.Artistes.AsNoTracking().Include(t => t.Titres).ToList(); this.logger.LogDebug("{Count} artistes récupérés de la base.", artistes.Count); return artistes; } diff --git a/Webzine.Repository/DbTitreRepository.cs b/Webzine.Repository/DbTitreRepository.cs index 20b90fd..66ebec5 100644 --- a/Webzine.Repository/DbTitreRepository.cs +++ b/Webzine.Repository/DbTitreRepository.cs @@ -242,6 +242,7 @@ public class DbTitreRepository : ITitreRepository .Include(t => t.Styles) .Where(t => t.Libelle.ToLower().Contains(mot.ToLower())) .OrderBy(t => t.Libelle) + .AsNoTracking() .ToList(); this.logger.LogDebug("{Count} titres trouvés correspondant à '{Mot}'", titres.Count, mot); diff --git a/Webzine.WebApplication/Controllers/RechercheController.cs b/Webzine.WebApplication/Controllers/RechercheController.cs index 9d6f7e2..061c9d6 100644 --- a/Webzine.WebApplication/Controllers/RechercheController.cs +++ b/Webzine.WebApplication/Controllers/RechercheController.cs @@ -8,52 +8,32 @@ namespace Webzine.WebApplication.Controllers using Webzine.Repository.Contracts; using Webzine.WebApplication.ViewModels.Recherche; - using Webzine.WebApplication.ViewModels.Titre; - [Route("recherche")] public class RechercheController : Controller { private readonly ILogger logger; private readonly ITitreRepository titreRepository; + private readonly IArtisteRepository artisteRepository; - public RechercheController(ILogger logger, ITitreRepository titreRepository) + public RechercheController( + ILogger logger, + ITitreRepository titreRepository, + IArtisteRepository artisteRepository) { this.logger = logger; this.titreRepository = titreRepository; + this.artisteRepository = artisteRepository; } - [HttpPost("")] public IActionResult Index(string mot) { this.logger.LogInformation("Recherche artistes/titres pour le mot : {Mot}.", mot); - var titres = this.titreRepository.Search(mot) - .Concat(this.titreRepository.SearchByStyle(mot)) - .DistinctBy(t => t.IdTitre) - .OrderBy(t => t.Libelle) - .Select(t => new TitreStyleItem - { - IdTitre = t.IdTitre, - Libelle = t.Libelle, - ArtisteNom = t.Artiste?.Nom, - UrlJaquette = t.UrlJaquette, - Duree = t.Duree, - }) - .ToList(); + var titres = this.titreRepository.Search(mot).ToList(); - var artistes = this.titreRepository.FindAll() - .Select(t => t.Artiste) - .Where(a => a != null - && !string.IsNullOrWhiteSpace(a.Nom) - && !string.IsNullOrWhiteSpace(mot) - && a.Nom.Contains(mot, StringComparison.OrdinalIgnoreCase)) - .DistinctBy(a => a!.IdArtiste) - .OrderBy(a => a!.Nom) - .Select(a => new RechercheArtisteItem - { - Nom = a!.Nom, - NombreDeTitres = a.Titres?.Count ?? 0, - }) + var artistes = this.artisteRepository + .FindAll() + .Where(a => a.Nom.ToLower().Contains(mot.ToLower())) .ToList(); var vm = new RechercheIndexViewModel diff --git a/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs b/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs index 177125d..7a53090 100644 --- a/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs +++ b/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs @@ -1,24 +1,24 @@ -using Webzine.WebApplication.ViewModels.Titre; - -namespace Webzine.WebApplication.ViewModels.Recherche; - -/// -/// ViewModel pour afficher les resultats de recherche d'artistes et de titres. -/// -public class RechercheIndexViewModel +namespace Webzine.WebApplication.ViewModels.Recherche { + using Webzine.Entity; /// - /// Mot saisi dans le formulaire. + /// ViewModel pour afficher les resultats de recherche d'artistes et de titres. /// - public string? Mot { get; set; } + public class RechercheIndexViewModel + { + /// + /// Mot saisi dans le formulaire. + /// + public string? Mot { get; set; } - /// - /// Artistes trouves. - /// - public List Artistes { get; set; } = new (); + /// + /// Artistes trouves. + /// + public List Artistes { get; set; } = new (); - /// - /// Titres trouves. - /// - public List Titres { get; set; } = new (); + /// + /// Titres trouves. + /// + public List Titres { get; set; } = new (); + } } \ No newline at end of file diff --git a/Webzine.WebApplication/Views/Recherche/Index.cshtml b/Webzine.WebApplication/Views/Recherche/Index.cshtml index cb5fca6..53e3853 100644 --- a/Webzine.WebApplication/Views/Recherche/Index.cshtml +++ b/Webzine.WebApplication/Views/Recherche/Index.cshtml @@ -10,74 +10,65 @@

Resultats pour "@Model.Mot"


+

Artistes

- @if (string.IsNullOrWhiteSpace(Model.Mot)) + @if (!Model.Artistes.Any()) {
- Saisissez un mot-cle pour lancer une recherche. +

Aucun artiste n'a t trouv.

} - else if (!Model.Artistes.Any() && !Model.Titres.Any()) + + @foreach (var artiste in Model.Artistes) + { +
+ + @artiste.Nom + + (@artiste.Titres.Count titre(s)) +
+ } +

Titres

+ + @if (!Model.Titres.Any()) {
- Aucun artiste ni titre ne correspond a votre recherche. +

Aucun titre n'a t trouv.

} - else - { - @if (Model.Artistes.Any()) - { -

Artistes

- @foreach (var artiste in Model.Artistes) - { -
+ @foreach (var titre in Model.Titres) + { +
+ + @titre.Libelle + + +
+ - } - } - - @if (Model.Titres.Any()) - { -

Titres

- - @foreach (var titre in Model.Titres) - { -
+ - - @titre.Libelle + asp-route-id="@titre.IdTitre"> + @titre.Libelle - -
- - -
- Duree : @TimeSpan.FromSeconds(titre.Duree).ToString(@"mm\:ss") -
-
- } - } + +
+ Duree : @TimeSpan.FromSeconds(titre.Duree).ToString(@"mm\:ss") +
+
+
}
diff --git a/wwwroot/css/site.css b/wwwroot/css/site.css deleted file mode 100644 index e69de29..0000000 From 559ca16563a0ba27c4bb21fabfce33a3bd7f8393 Mon Sep 17 00:00:00 2001 From: "b.nodon" Date: Tue, 31 Mar 2026 13:27:27 +0200 Subject: [PATCH 006/105] #152 rework des routes: - Routes admin --- .../Extensions/RouteConfiguration.cs | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Webzine.WebApplication/Extensions/RouteConfiguration.cs b/Webzine.WebApplication/Extensions/RouteConfiguration.cs index a3df301..bea0942 100644 --- a/Webzine.WebApplication/Extensions/RouteConfiguration.cs +++ b/Webzine.WebApplication/Extensions/RouteConfiguration.cs @@ -7,6 +7,52 @@ public static class RouteConfiguration /// public static void MapCustomRoutes(this IEndpointRouteBuilder endpoints) { + // --- ARTISTES --- + endpoints.MapControllerRoute( + name: "AdminArtistesIndex", + pattern: "administration/artistes", + defaults: new { area = "Administration", controller = "Artiste", action = "Index" }); + + endpoints.MapControllerRoute( + name: "AdminArtisteActions", + pattern: "administration/artiste/{action}/{id?}", + defaults: new { area = "Administration", controller = "Artiste" }); + + // --- COMMENTAIRES --- + endpoints.MapControllerRoute( + name: "AdminCommentairesIndex", + pattern: "administration/commentaires", + defaults: new { area = "Administration", controller = "Commentaire", action = "Index" }); + + endpoints.MapControllerRoute( + name: "AdminCommentaireActions", + pattern: "administration/commentaire/{action}/{id?}", + defaults: new { area = "Administration", controller = "Commentaire" }); + + // --- STYLES --- + endpoints.MapControllerRoute( + name: "AdminStylesIndex", + pattern: "administration/styles", + defaults: new { area = "Administration", controller = "Style", action = "Index" }); + + endpoints.MapControllerRoute( + name: "AdminStyleActions", + pattern: "administration/style/{action}/{id?}", + defaults: new { area = "Administration", controller = "Style" }); + + // --- TITRES --- + endpoints.MapControllerRoute( + name: "AdminTitresIndex", + pattern: "administration/titres", + defaults: new { area = "Administration", controller = "Titre", action = "Index" }); + + endpoints.MapControllerRoute( + name: "AdminTitreActions", + pattern: "administration/titre/{action}/{id?}", + defaults: new { area = "Administration", controller = "Titre" }); + + // --- AUTRE PROUTES --- + endpoints.MapControllerRoute( name: "areas", pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}"); From e5ecf75f496324ab2483a585da2a709b54d7a4b1 Mon Sep 17 00:00:00 2001 From: Loic Masi Date: Tue, 31 Mar 2026 13:30:47 +0200 Subject: [PATCH 007/105] =?UTF-8?q?#154=20:=20D=C3=A9placement=20de=20la?= =?UTF-8?q?=20recherche=20des=20artistes=20dans=20les=20RepositoryArtiste.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IArtisteRepository.cs | 7 +++++++ Webzine.Repository/DbArtisteRepository.cs | 20 +++++++++++++++++-- Webzine.Repository/LocalArtisteRepository.cs | 8 ++++++++ .../Controllers/RechercheController.cs | 7 ++----- .../Recherche/RechercheIndexViewModel.cs | 4 ++-- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Webzine.Repository.Contracts/IArtisteRepository.cs b/Webzine.Repository.Contracts/IArtisteRepository.cs index 1ab6e83..49754b4 100644 --- a/Webzine.Repository.Contracts/IArtisteRepository.cs +++ b/Webzine.Repository.Contracts/IArtisteRepository.cs @@ -44,5 +44,12 @@ namespace Webzine.Repository.Contracts /// /// L'artiste à mettre à jour. void Update(Artiste artiste); + + /// + /// Récupérer une liste d'artiste à partir d'une recherche. + /// + /// Nom de l'artiste. + /// IEnumarble qui contient la chaine de caractere. + IEnumerable Search(string nom); } } \ No newline at end of file diff --git a/Webzine.Repository/DbArtisteRepository.cs b/Webzine.Repository/DbArtisteRepository.cs index 2546bc7..f12617c 100644 --- a/Webzine.Repository/DbArtisteRepository.cs +++ b/Webzine.Repository/DbArtisteRepository.cs @@ -4,8 +4,6 @@ namespace Webzine.Repository { - using System.Data.Common; - using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -156,5 +154,23 @@ namespace Webzine.Repository throw; } } + + /// + public IEnumerable Search(string mot) + { + try + { + var artiste = this.context.Artistes + .Where(a => a.Nom.ToLower().Contains(mot.ToLower())) + .Include(t => t.Titres) + .AsNoTracking() + .ToList(); + return artiste; + } + catch (Exception ex) + { + throw new Exception("Erreur lors de la recherche d'artiste {error}", ex); + } + } } } \ No newline at end of file diff --git a/Webzine.Repository/LocalArtisteRepository.cs b/Webzine.Repository/LocalArtisteRepository.cs index 67ebabf..69021c5 100644 --- a/Webzine.Repository/LocalArtisteRepository.cs +++ b/Webzine.Repository/LocalArtisteRepository.cs @@ -85,5 +85,13 @@ namespace Webzine.Repository { throw new NotSupportedException("Mode Local"); } + + /// + public IEnumerable Search(string mot) + { + return this.dataStore.Artistes + .Where(a => a.Nom.ToLower().Contains(mot.ToLower())) + .ToList(); + } } } \ No newline at end of file diff --git a/Webzine.WebApplication/Controllers/RechercheController.cs b/Webzine.WebApplication/Controllers/RechercheController.cs index 061c9d6..729cf64 100644 --- a/Webzine.WebApplication/Controllers/RechercheController.cs +++ b/Webzine.WebApplication/Controllers/RechercheController.cs @@ -29,12 +29,9 @@ namespace Webzine.WebApplication.Controllers { this.logger.LogInformation("Recherche artistes/titres pour le mot : {Mot}.", mot); - var titres = this.titreRepository.Search(mot).ToList(); + var titres = this.titreRepository.Search(mot); - var artistes = this.artisteRepository - .FindAll() - .Where(a => a.Nom.ToLower().Contains(mot.ToLower())) - .ToList(); + var artistes = this.artisteRepository.Search(mot); var vm = new RechercheIndexViewModel { diff --git a/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs b/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs index 7a53090..3132306 100644 --- a/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs +++ b/Webzine.WebApplication/ViewModels/Recherche/RechercheIndexViewModel.cs @@ -14,11 +14,11 @@ namespace Webzine.WebApplication.ViewModels.Recherche /// /// Artistes trouves. /// - public List Artistes { get; set; } = new (); + public IEnumerable Artistes { get; set; } = new List(); /// /// Titres trouves. /// - public List Titres { get; set; } = new (); + public IEnumerable Titres { get; set; } = new List(); } } \ No newline at end of file From f573ac2455d32101bd54422b8f9d8232b866e5f6 Mon Sep 17 00:00:00 2001 From: "josephine.vetu" Date: Tue, 31 Mar 2026 13:41:04 +0200 Subject: [PATCH 008/105] #144 Ajout de la date et de mon nom sur la table des modifications. Modification de stylecop pour correspondre au cahier des charges. --- .../Installation/equipe 1 - dossier de configuration.md | 1 + Webzine.Documentation/StyleCop/stylecop.json | 8 ++------ .../ViewModels/Commentaire/CommentaireViewModel.cs | 4 ++-- .../ViewModels/Styles/StyleCreateViewModel.cs | 4 ++-- .../ViewModels/Styles/StyleDeleteViewModel.cs | 4 ++-- .../ViewModels/Styles/StyleEditViewModel.cs | 4 ++-- Webzine.WebApplication/Controllers/RechercheController.cs | 4 ++-- Webzine.WebApplication/Controllers/TitreController.cs | 4 ++-- 8 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md b/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md index d99576d..ee3333a 100644 --- a/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md +++ b/Webzine.Documentation/Installation/equipe 1 - dossier de configuration.md @@ -11,6 +11,7 @@ | Date | Auteur | | ----- | ------------- | | 25/03 | Clément Bobin | +| 31/03 | Joséphine Vetu | --- diff --git a/Webzine.Documentation/StyleCop/stylecop.json b/Webzine.Documentation/StyleCop/stylecop.json index c2b8c42..52ce63b 100644 --- a/Webzine.Documentation/StyleCop/stylecop.json +++ b/Webzine.Documentation/StyleCop/stylecop.json @@ -2,12 +2,8 @@ "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", "settings": { "documentationRules": { + "companyName": "Equipe 1 - BOBIN, MASI, NODON, VETU", "documentationCulture": "fr-FR" - }, - "maintainabilityRules": { - "settings": { - "commonWords": [ "Obtient", "définit" ] - } + } } } -} diff --git a/Webzine.WebApplication/Areas/Administration/ViewModels/Commentaire/CommentaireViewModel.cs b/Webzine.WebApplication/Areas/Administration/ViewModels/Commentaire/CommentaireViewModel.cs index 722612d..1ca07fd 100644 --- a/Webzine.WebApplication/Areas/Administration/ViewModels/Commentaire/CommentaireViewModel.cs +++ b/Webzine.WebApplication/Areas/Administration/ViewModels/Commentaire/CommentaireViewModel.cs @@ -1,5 +1,5 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. +// +// Copyright (c) Equipe 1 - BOBIN, MASI, NODON, VETU. All rights reserved. // namespace Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire diff --git a/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleCreateViewModel.cs b/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleCreateViewModel.cs index e744af0..3cd24d4 100644 --- a/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleCreateViewModel.cs +++ b/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleCreateViewModel.cs @@ -1,5 +1,5 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. +// +// Copyright (c) Equipe 1 - BOBIN, MASI, NODON, VETU. All rights reserved. // namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style diff --git a/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleDeleteViewModel.cs b/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleDeleteViewModel.cs index 0b882a3..fc94e54 100644 --- a/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleDeleteViewModel.cs +++ b/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleDeleteViewModel.cs @@ -1,5 +1,5 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. +// +// Copyright (c) Equipe 1 - BOBIN, MASI, NODON, VETU. All rights reserved. // namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style diff --git a/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleEditViewModel.cs b/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleEditViewModel.cs index c252e66..9095f60 100644 --- a/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleEditViewModel.cs +++ b/Webzine.WebApplication/Areas/Administration/ViewModels/Styles/StyleEditViewModel.cs @@ -1,5 +1,5 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. +// +// Copyright (c) Equipe 1 - BOBIN, MASI, NODON, VETU. All rights reserved. // namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style diff --git a/Webzine.WebApplication/Controllers/RechercheController.cs b/Webzine.WebApplication/Controllers/RechercheController.cs index 9d6f7e2..4676c9d 100644 --- a/Webzine.WebApplication/Controllers/RechercheController.cs +++ b/Webzine.WebApplication/Controllers/RechercheController.cs @@ -1,5 +1,5 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. +// +// Copyright (c) Equipe 1 - BOBIN, MASI, NODON, VETU. All rights reserved. // namespace Webzine.WebApplication.Controllers diff --git a/Webzine.WebApplication/Controllers/TitreController.cs b/Webzine.WebApplication/Controllers/TitreController.cs index 76ad52b..01b1239 100644 --- a/Webzine.WebApplication/Controllers/TitreController.cs +++ b/Webzine.WebApplication/Controllers/TitreController.cs @@ -1,5 +1,5 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. +// +// Copyright (c) Equipe 1 - BOBIN, MASI, NODON, VETU. All rights reserved. // namespace Webzine.WebApplication.Controllers From b9dd6f04d9d046dadd1b202c0f197fdc70f2f6db Mon Sep 17 00:00:00 2001 From: "josephine.vetu" Date: Sat, 28 Mar 2026 09:59:42 +0100 Subject: [PATCH 009/105] Ajout de editorconfig pour formatter le code + supprimer la mention copyright sur tous les fichiers. --- .editorconfig | 393 +++++++++++++++++++ Webzine.Documentation/StyleCop/stylecop.json | 12 +- 2 files changed, 402 insertions(+), 3 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d1d7d33 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,393 @@ +root = true + +# All files +[*] +indent_style = space + +# Xml files +[*.xml] +indent_size = 2 + +# Xml project files +[*.{csproj,fsproj,vbproj,proj,slnx}] +indent_size = 2 + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +[*.json] +indent_size = 2 + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +tab_width = 4 + +# New line preferences +insert_final_newline = false + +#### .NET Coding Conventions #### +[*.{cs,vb}] + +# Organize usings +dotnet_separate_import_directive_groups = true +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:silent +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_property = false:silent + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent + +# Expression-level preferences +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_object_initializer = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_return = true:suggestion +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion + +# Field preferences +dotnet_style_readonly_field = true:warning + +# Parameter preferences +dotnet_code_quality_unused_parameters = all:suggestion + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +#### C# Coding Conventions #### +[*.cs] + +# var preferences +csharp_style_var_elsewhere = false:silent +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:suggestion +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_extended_property_pattern = true:suggestion +csharp_style_prefer_not_pattern = true:suggestion +csharp_style_prefer_pattern_matching = true:silent +csharp_style_prefer_switch_expression = true:suggestion + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:suggestion + +# Modifier preferences +csharp_prefer_static_anonymous_function = true:suggestion +csharp_prefer_static_local_function = true:warning +csharp_preferred_modifier_order = public,private,protected,internal,file,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion +csharp_style_prefer_readonly_struct = true:suggestion +csharp_style_prefer_readonly_struct_member = true:suggestion + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_style_namespace_declarations = file_scoped:suggestion +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_prefer_top_level_statements = true:silent + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_local_over_anonymous_function = true:suggestion +csharp_style_prefer_null_check_over_type_check = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_prefer_tuple_swap = true:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +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 = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# 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 styles #### +[*.{cs,vb}] + +# Naming rules + +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion +dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces +dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase + +dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion +dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters +dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase + +dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods +dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties +dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.events_should_be_pascalcase.symbols = events +dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables +dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase + +dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants +dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase + +dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion +dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters +dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase + +dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields +dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion +dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields +dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase + +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase + +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums +dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase + +# Symbol specifications + +dotnet_naming_symbols.interfaces.applicable_kinds = interface +dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interfaces.required_modifiers = + +dotnet_naming_symbols.enums.applicable_kinds = enum +dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.enums.required_modifiers = + +dotnet_naming_symbols.events.applicable_kinds = event +dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.events.required_modifiers = + +dotnet_naming_symbols.methods.applicable_kinds = method +dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.methods.required_modifiers = + +dotnet_naming_symbols.properties.applicable_kinds = property +dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.properties.required_modifiers = + +dotnet_naming_symbols.public_fields.applicable_kinds = field +dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_fields.required_modifiers = + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_fields.required_modifiers = + +dotnet_naming_symbols.private_static_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_fields.required_modifiers = static + +dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum +dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types_and_namespaces.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 = + +dotnet_naming_symbols.type_parameters.applicable_kinds = namespace +dotnet_naming_symbols.type_parameters.applicable_accessibilities = * +dotnet_naming_symbols.type_parameters.required_modifiers = + +dotnet_naming_symbols.private_constant_fields.applicable_kinds = field +dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_constant_fields.required_modifiers = const + +dotnet_naming_symbols.local_variables.applicable_kinds = local +dotnet_naming_symbols.local_variables.applicable_accessibilities = local +dotnet_naming_symbols.local_variables.required_modifiers = + +dotnet_naming_symbols.local_constants.applicable_kinds = local +dotnet_naming_symbols.local_constants.applicable_accessibilities = local +dotnet_naming_symbols.local_constants.required_modifiers = const + +dotnet_naming_symbols.parameters.applicable_kinds = parameter +dotnet_naming_symbols.parameters.applicable_accessibilities = * +dotnet_naming_symbols.parameters.required_modifiers = + +dotnet_naming_symbols.public_constant_fields.applicable_kinds = field +dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_constant_fields.required_modifiers = const + +dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static + +dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function +dotnet_naming_symbols.local_functions.applicable_accessibilities = * +dotnet_naming_symbols.local_functions.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascalcase.required_prefix = +dotnet_naming_style.pascalcase.required_suffix = +dotnet_naming_style.pascalcase.word_separator = +dotnet_naming_style.pascalcase.capitalization = pascal_case + +dotnet_naming_style.ipascalcase.required_prefix = I +dotnet_naming_style.ipascalcase.required_suffix = +dotnet_naming_style.ipascalcase.word_separator = +dotnet_naming_style.ipascalcase.capitalization = pascal_case + +dotnet_naming_style.tpascalcase.required_prefix = T +dotnet_naming_style.tpascalcase.required_suffix = +dotnet_naming_style.tpascalcase.word_separator = +dotnet_naming_style.tpascalcase.capitalization = pascal_case + +dotnet_naming_style._camelcase.required_prefix = _ +dotnet_naming_style._camelcase.required_suffix = +dotnet_naming_style._camelcase.word_separator = +dotnet_naming_style._camelcase.capitalization = camel_case + +dotnet_naming_style.camelcase.required_prefix = +dotnet_naming_style.camelcase.required_suffix = +dotnet_naming_style.camelcase.word_separator = +dotnet_naming_style.camelcase.capitalization = camel_case + +dotnet_naming_style.s_camelcase.required_prefix = s_ +dotnet_naming_style.s_camelcase.required_suffix = +dotnet_naming_style.s_camelcase.word_separator = +dotnet_naming_style.s_camelcase.capitalization = camel_case + +dotnet_diagnostic.SA1623.severity = none +dotnet_diagnostic.SA1624.severity = none + +dotnet_diagnostic.SA1600.severity = suggestion \ No newline at end of file diff --git a/Webzine.Documentation/StyleCop/stylecop.json b/Webzine.Documentation/StyleCop/stylecop.json index 81a3ce9..b387567 100644 --- a/Webzine.Documentation/StyleCop/stylecop.json +++ b/Webzine.Documentation/StyleCop/stylecop.json @@ -2,8 +2,14 @@ "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", "settings": { "documentationRules": { - "companyName": " Equipe 1 - ", - "documentationCulture": "fr-FR" - } + "documentInterfaces": false, + "documentInternalElements": false, + "documentExposedElements": false + }, + "maintainabilityRules": { + "settings": { + "commonWords": [ "Obtient", "définit" ] + } } } +} From 18075a979267685140970c40e13fd0826fd88838 Mon Sep 17 00:00:00 2001 From: "josephine.vetu" Date: Sat, 28 Mar 2026 10:06:43 +0100 Subject: [PATCH 010/105] Fix d'editconfig pour ne pas ajouter de copyright --- .editorconfig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index d1d7d33..9896049 100644 --- a/.editorconfig +++ b/.editorconfig @@ -390,4 +390,14 @@ dotnet_naming_style.s_camelcase.capitalization = camel_case dotnet_diagnostic.SA1623.severity = none dotnet_diagnostic.SA1624.severity = none -dotnet_diagnostic.SA1600.severity = suggestion \ No newline at end of file +dotnet_diagnostic.SA1600.severity = suggestion + +[*.cs] +# 1. Tell the .NET Formatter to stop injecting a header +file_header_template = unset + +# 2. Tell StyleCop to stop requiring a file header (SA1633) +dotnet_diagnostic.SA1633.severity = none + +# 3. Tell the IDE to stop requiring a file header (IDE0073) +dotnet_diagnostic.IDE0073.severity = none \ No newline at end of file From fe2a339fc119727ec8e256bab56831ced2007615 Mon Sep 17 00:00:00 2001 From: "josephine.vetu" Date: Sat, 28 Mar 2026 10:09:18 +0100 Subject: [PATCH 011/105] Commande dotnet format --- Webzine.EntitiesContext/WebzineDbContext.cs | 7 +- Webzine.Entity.Tests/CommentaireTests.cs | 2 +- Webzine.Entity.Tests/Common.cs | 33 ++--- Webzine.Entity.Tests/TitreTests.cs | 2 +- Webzine.Entity/Artiste.cs | 8 +- Webzine.Entity/Commentaire.cs | 8 +- Webzine.Entity/Fixtures/ArtisteFactory.cs | 8 +- Webzine.Entity/Fixtures/CommentaireFactory.cs | 7 +- Webzine.Entity/Fixtures/DataFactory.cs | 131 ++++++++++-------- Webzine.Entity/Fixtures/SeedDataLocal.cs | 5 +- Webzine.Entity/Fixtures/SeedDataSpotify.cs | 1 - Webzine.Entity/Fixtures/StyleFactory.cs | 4 +- Webzine.Entity/Fixtures/TitreFactory.cs | 23 +-- Webzine.Entity/Style.cs | 8 +- Webzine.Entity/Titre.cs | 8 +- .../IArtisteRepository.cs | 3 +- .../ICommentaireRepository.cs | 4 +- .../IStyleRepository.cs | 4 +- .../ITitreRepository.cs | 8 +- Webzine.Repository/DbArtisteRepository.cs | 14 +- Webzine.Repository/DbCommentaireRepository.cs | 3 +- Webzine.Repository/DbTitreRepository.cs | 2 +- Webzine.Repository/InMemoryDataStore.cs | 14 +- Webzine.Repository/LocalArtisteRepository.cs | 8 +- .../LocalCommentaireRepository.cs | 11 +- Webzine.Repository/LocalStyleRepository.cs | 3 +- .../Controllers/ArtisteController.cs | 1 + .../Controllers/CommentaireController.cs | 21 +-- .../Controllers/DashboardController.cs | 1 + .../Controllers/StyleController.cs | 13 +- .../Controllers/TitreController.cs | 2 +- .../ViewModels/Artiste/AdminArtisteForm.cs | 4 +- .../Commentaire/CommentaireViewModel.cs | 4 +- .../ViewModels/DashboardViewModel.cs | 3 +- .../ViewModels/Styles/StyleCreateViewModel.cs | 9 +- .../ViewModels/Styles/StyleDeleteViewModel.cs | 10 +- .../ViewModels/Styles/StyleEditViewModel.cs | 11 +- .../ViewModels/Titre/AdminTitreForm.cs | 2 +- .../Controllers/AccueilController.cs | 8 +- .../Controllers/ApiController.cs | 11 +- .../Controllers/ArtisteController.cs | 13 +- .../Controllers/ContactController.cs | 9 +- .../Controllers/RechercheController.cs | 7 +- .../Controllers/TitreController.cs | 8 +- Webzine.WebApplication/Program.cs | 4 +- .../ViewComponents/SidebarViewComponent.cs | 6 +- .../Artiste/ArtisteDetailsViewModel.cs | 3 +- .../Recherche/RechercheArtisteItem.cs | 2 +- .../Recherche/RechercheIndexViewModel.cs | 6 +- .../ViewModels/Titre/TitreContent.cs | 4 +- .../ViewModels/Titre/TitreStyle.cs | 2 +- 51 files changed, 265 insertions(+), 228 deletions(-) diff --git a/Webzine.EntitiesContext/WebzineDbContext.cs b/Webzine.EntitiesContext/WebzineDbContext.cs index ea218bf..e3f5e8a 100644 --- a/Webzine.EntitiesContext/WebzineDbContext.cs +++ b/Webzine.EntitiesContext/WebzineDbContext.cs @@ -5,6 +5,7 @@ namespace Webzine.EntitiesContext { using Microsoft.EntityFrameworkCore; + using Webzine.Entity; public class WebzineDbContext : DbContext @@ -14,7 +15,9 @@ namespace Webzine.EntitiesContext /// /// Options. public WebzineDbContext(DbContextOptions options) - : base(options) { } + : base(options) + { + } /// /// Gets Obtient les artistes de la base. @@ -102,4 +105,4 @@ namespace Webzine.EntitiesContext }); } } -} +} \ No newline at end of file diff --git a/Webzine.Entity.Tests/CommentaireTests.cs b/Webzine.Entity.Tests/CommentaireTests.cs index a5f1ad7..ea7122a 100644 --- a/Webzine.Entity.Tests/CommentaireTests.cs +++ b/Webzine.Entity.Tests/CommentaireTests.cs @@ -106,4 +106,4 @@ namespace Webzine.Entity.Tests Common.HasProperty(typeof(Commentaire), nameof(Commentaire.Titre)); } } -} +} \ No newline at end of file diff --git a/Webzine.Entity.Tests/Common.cs b/Webzine.Entity.Tests/Common.cs index 531ab5d..f567684 100644 --- a/Webzine.Entity.Tests/Common.cs +++ b/Webzine.Entity.Tests/Common.cs @@ -3,6 +3,7 @@ namespace Webzine.Entity.Tests using System; using System.ComponentModel.DataAnnotations; using System.Linq; + using Microsoft.VisualStudio.TestTools.UnitTesting; /// @@ -13,8 +14,8 @@ namespace Webzine.Entity.Tests /// /// Vérifie que l'entité possède bien la propriété passée en paramètre. /// - /// type de l'entité - /// nom de la propriété de l'entité + /// type de l'entité. + /// nom de la propriété de l'entité. public static void HasProperty(Type typeObjet, string nomPropriete) { var property = typeObjet.GetProperty(nomPropriete); @@ -24,9 +25,9 @@ namespace Webzine.Entity.Tests /// /// Vérifie que l'attribut de l'entité a l'annotation [Display(Name = "xxx")] avec la valeur attendue. /// - /// type de l'entité - /// nom de la propriété de l'entité - /// valeur attendue pour l'affichage de cette propriété + /// type de l'entité. + /// nom de la propriété de l'entité. + /// valeur attendue pour l'affichage de cette propriété. public static void AttributDisplay(Type typeObjet, string nomPropriete, string chaineAttendue) { var property = typeObjet.GetProperty(nomPropriete); @@ -38,9 +39,9 @@ namespace Webzine.Entity.Tests /// /// Vérifie que l'attribut de l'entité a l'annotation [MinLength(xx)] avec la longueur attendue. /// - /// type de l'entité - /// nom de la propriété de l'entité - /// longueur maximum + /// type de l'entité. + /// nom de la propriété de l'entité. + /// longueur maximum. public static void AttributLongueurMax(Type typeObjet, string nomPropriete, int max) { var property = typeObjet.GetProperty(nomPropriete); @@ -52,9 +53,9 @@ namespace Webzine.Entity.Tests /// /// Vérifie que l'attribut de l'entité a l'annotation [MinLength(xx)] avec la longueur attendue. /// - /// type de l'entité - /// nom de la propriété de l'entité - /// longueur minimum + /// type de l'entité. + /// nom de la propriété de l'entité. + /// longueur minimum. public static void AttributLongueurMin(Type typeObjet, string nomPropriete, int min) { var property = typeObjet.GetProperty(nomPropriete); @@ -66,8 +67,8 @@ namespace Webzine.Entity.Tests /// /// Vérifie que l'attribut de l'entité a l'annotation [Required]. /// - /// type de l'entité - /// nom de la propriété de l'entité + /// type de l'entité. + /// nom de la propriété de l'entité. public static void AttributRequis(Type typeObjet, string nomPropriete) { var property = typeObjet.GetProperty(nomPropriete); @@ -78,8 +79,8 @@ namespace Webzine.Entity.Tests /// /// Vérifie que l'attribut de l'entité n'a pas l'annotation [Url]. /// - /// type de l'entité - /// nom de la propriété de l'entité + /// type de l'entité. + /// nom de la propriété de l'entité. public static void AttributHasNotUrlValidation(Type typeObjet, string nomPropriete) { var property = typeObjet.GetProperty(nomPropriete); @@ -87,4 +88,4 @@ namespace Webzine.Entity.Tests Assert.IsNull(annotation, "La propriété '" + nomPropriete + "' ne doit pas être une URL obligatoirement. Retirez l'annotation Url."); } } -} +} \ No newline at end of file diff --git a/Webzine.Entity.Tests/TitreTests.cs b/Webzine.Entity.Tests/TitreTests.cs index 9908434..fe83a89 100644 --- a/Webzine.Entity.Tests/TitreTests.cs +++ b/Webzine.Entity.Tests/TitreTests.cs @@ -238,4 +238,4 @@ namespace Webzine.Entity.Tests Common.AttributHasNotUrlValidation(typeof(Titre), nameof(Titre.UrlJaquette)); } } -} +} \ No newline at end of file diff --git a/Webzine.Entity/Artiste.cs b/Webzine.Entity/Artiste.cs index 5cd404e..f01047e 100644 --- a/Webzine.Entity/Artiste.cs +++ b/Webzine.Entity/Artiste.cs @@ -1,7 +1,7 @@ -using System.ComponentModel.DataAnnotations; - -namespace Webzine.Entity +namespace Webzine.Entity { + using System.ComponentModel.DataAnnotations; + /// /// Classe représentant un artiste. /// Lien avec l'entité : un artiste peut avoir plusieurs titres, mais un titre n'a qu'un seul artiste. @@ -32,4 +32,4 @@ namespace Webzine.Entity /// public List Titres { get; set; } } -} +} \ No newline at end of file diff --git a/Webzine.Entity/Commentaire.cs b/Webzine.Entity/Commentaire.cs index b29c14e..5e86a9b 100644 --- a/Webzine.Entity/Commentaire.cs +++ b/Webzine.Entity/Commentaire.cs @@ -1,7 +1,7 @@ -using System.ComponentModel.DataAnnotations; - -namespace Webzine.Entity +namespace Webzine.Entity { + using System.ComponentModel.DataAnnotations; + /// /// Classe représentant un commentaire laissé par un utilisateur sur un titre. /// Lien avec l'entité : un titre peut avoir plusieurs commentaires, mais un commentaire n'a qu'un seul titre. @@ -48,4 +48,4 @@ namespace Webzine.Entity /// public Titre Titre { get; set; } } -} +} \ No newline at end of file diff --git a/Webzine.Entity/Fixtures/ArtisteFactory.cs b/Webzine.Entity/Fixtures/ArtisteFactory.cs index d8ecb26..ab0e11a 100644 --- a/Webzine.Entity/Fixtures/ArtisteFactory.cs +++ b/Webzine.Entity/Fixtures/ArtisteFactory.cs @@ -1,7 +1,7 @@ -using Bogus; - -namespace Webzine.Entity.Fixtures +namespace Webzine.Entity.Fixtures { + using Bogus; + /// /// Factory pour générer des artistes avec des titres associés, à l'aide de la bibliothèque Bogus. /// @@ -18,7 +18,7 @@ namespace Webzine.Entity.Fixtures var albumsData = new[] { new { Nom = "Bohemian Rhapsody", Image = "https://upload.wikimedia.org/wikipedia/en/9/9f/Bohemian_Rhapsody.png" }, - new { Nom = "Born This Way", Image = "https://static.wikia.nocookie.net/ladygaga/images/2/2d/BornThisWay-DeluxeEdition.jpg/revision/latest/scale-to-width-down/3500?cb=20111120030308" } + new { Nom = "Born This Way", Image = "https://static.wikia.nocookie.net/ladygaga/images/2/2d/BornThisWay-DeluxeEdition.jpg/revision/latest/scale-to-width-down/3500?cb=20111120030308" }, }; var faker = new Bogus.Faker("fr"); diff --git a/Webzine.Entity/Fixtures/CommentaireFactory.cs b/Webzine.Entity/Fixtures/CommentaireFactory.cs index c798b36..a756b49 100644 --- a/Webzine.Entity/Fixtures/CommentaireFactory.cs +++ b/Webzine.Entity/Fixtures/CommentaireFactory.cs @@ -2,12 +2,11 @@ // Copyright (c) PlaceholderCompany. All rights reserved. // -using Bogus; - namespace Webzine.Entity.Fixtures { + using Bogus; + public class CommentaireFactory { - } -} +} \ No newline at end of file diff --git a/Webzine.Entity/Fixtures/DataFactory.cs b/Webzine.Entity/Fixtures/DataFactory.cs index 8b6617d..23452f9 100644 --- a/Webzine.Entity/Fixtures/DataFactory.cs +++ b/Webzine.Entity/Fixtures/DataFactory.cs @@ -1,11 +1,13 @@ namespace Webzine.Entity.Fixtures; -using Entity; -using Faker; using System; using System.Collections.Generic; using System.Linq; +using Entity; + +using Faker; + public class DataFactory { /// @@ -14,54 +16,69 @@ public class DataFactory public Dictionary RealMusicData { get; set; } = new Dictionary { - { "juliana_chahayed_1", ("https://open.spotify.com/intl-fr/track/0qYLUdJQMhrCFA9dNZGcnm?si=b4fd45727a354a31", - "https://i.scdn.co/image/ab67616d0000b2738e8e7b8f8f8f8f8f8f8f8f8") }, - - { "mister_v_1", ("https://youtu.be/JeqUw7sGUK8?si=FnmFR2EgkVY6MhqQ", - "https://img.youtube.com/vi/JeqUw7sGUK8/maxresdefault.jpg") }, - - { "compagnie_creole_1", ("https://youtu.be/wfxt1SGWAI8", - "https://img.youtube.com/vi/wfxt1SGWAI8/maxresdefault.jpg") }, - - { "femto_1", ("https://open.spotify.com/intl-fr/track/0qYLUdJQMhrCFA9dNZGcnm?si=b4fd45727a354a31", - "https://i.scdn.co/image/ab67616d0000b2738e8e7b8f8f8f8f8f8f8f8f8") }, - - { "chat_noir_1", ("https://youtu.be/OTi4-q-_Tj0?si=SNnLd-6Y893nL5Au", - "https://img.youtube.com/vi/OTi4-q-_Tj0/maxresdefault.jpg") }, - - { "chat_noir_2", ("https://youtu.be/X-rJ01EyiAI?si=gH9m_U8oXI35OgWu", - "https://img.youtube.com/vi/X-rJ01EyiAI/maxresdefault.jpg") }, - - { "chat_noir_3", ("https://youtu.be/7lIM0wSx7kQ?si=S-RAsLzd4SiCQhE4", - "https://img.youtube.com/vi/7lIM0wSx7kQ/maxresdefault.jpg") }, - - { "chat_noir_4", ("https://youtu.be/dbxyKR1P8vA?si=aRzdYBhwvKptV8Ff", - "https://img.youtube.com/vi/dbxyKR1P8vA/maxresdefault.jpg") }, - - { "chat_noir_5", ("https://youtu.be/DDHvKo5NnII?si=NFRkdVQL2mELP0yn", - "https://img.youtube.com/vi/DDHvKo5NnII/maxresdefault.jpg") }, - - { "chat_noir_6", ("https://youtu.be/J9LgHNf2Qy0?si=YGO1ggiLkefa9901", - "https://img.youtube.com/vi/J9LgHNf2Qy0/maxresdefault.jpg") }, - - { "chat_noir_7", ("https://youtu.be/oadhHk2xs6c?si=mbnJCA6SGsoYXnUK", - "https://img.youtube.com/vi/oadhHk2xs6c/maxresdefault.jpg") }, - - { "chat_noir_8", ("https://youtu.be/6K1zCgkBaoE?si=quq9vQLJ-AmzjRJJ", - "https://img.youtube.com/vi/6K1zCgkBaoE/maxresdefault.jpg") }, - - { "german_rapper_1", ("https://www.youtube.com/watch?v=DWpg71HJt24", - "https://img.youtube.com/vi/DWpg71HJt24/maxresdefault.jpg") }, - - { "nizard_1", ("https://youtu.be/1fjA68k8DAU?si=2PuZSquVQGvfmQkZ", - "https://img.youtube.com/vi/1fjA68k8DAU/maxresdefault.jpg") }, + { + "juliana_chahayed_1", ("https://open.spotify.com/intl-fr/track/0qYLUdJQMhrCFA9dNZGcnm?si=b4fd45727a354a31", + "https://i.scdn.co/image/ab67616d0000b2738e8e7b8f8f8f8f8f8f8f8f8") + }, + { + "mister_v_1", ("https://youtu.be/JeqUw7sGUK8?si=FnmFR2EgkVY6MhqQ", + "https://img.youtube.com/vi/JeqUw7sGUK8/maxresdefault.jpg") + }, + { + "compagnie_creole_1", ("https://youtu.be/wfxt1SGWAI8", + "https://img.youtube.com/vi/wfxt1SGWAI8/maxresdefault.jpg") + }, + { + "femto_1", ("https://open.spotify.com/intl-fr/track/0qYLUdJQMhrCFA9dNZGcnm?si=b4fd45727a354a31", + "https://i.scdn.co/image/ab67616d0000b2738e8e7b8f8f8f8f8f8f8f8f8") + }, + { + "chat_noir_1", ("https://youtu.be/OTi4-q-_Tj0?si=SNnLd-6Y893nL5Au", + "https://img.youtube.com/vi/OTi4-q-_Tj0/maxresdefault.jpg") + }, + { + "chat_noir_2", ("https://youtu.be/X-rJ01EyiAI?si=gH9m_U8oXI35OgWu", + "https://img.youtube.com/vi/X-rJ01EyiAI/maxresdefault.jpg") + }, + { + "chat_noir_3", ("https://youtu.be/7lIM0wSx7kQ?si=S-RAsLzd4SiCQhE4", + "https://img.youtube.com/vi/7lIM0wSx7kQ/maxresdefault.jpg") + }, + { + "chat_noir_4", ("https://youtu.be/dbxyKR1P8vA?si=aRzdYBhwvKptV8Ff", + "https://img.youtube.com/vi/dbxyKR1P8vA/maxresdefault.jpg") + }, + { + "chat_noir_5", ("https://youtu.be/DDHvKo5NnII?si=NFRkdVQL2mELP0yn", + "https://img.youtube.com/vi/DDHvKo5NnII/maxresdefault.jpg") + }, + { + "chat_noir_6", ("https://youtu.be/J9LgHNf2Qy0?si=YGO1ggiLkefa9901", + "https://img.youtube.com/vi/J9LgHNf2Qy0/maxresdefault.jpg") + }, + { + "chat_noir_7", ("https://youtu.be/oadhHk2xs6c?si=mbnJCA6SGsoYXnUK", + "https://img.youtube.com/vi/oadhHk2xs6c/maxresdefault.jpg") + }, + { + "chat_noir_8", ("https://youtu.be/6K1zCgkBaoE?si=quq9vQLJ-AmzjRJJ", + "https://img.youtube.com/vi/6K1zCgkBaoE/maxresdefault.jpg") + }, + { + "german_rapper_1", ("https://www.youtube.com/watch?v=DWpg71HJt24", + "https://img.youtube.com/vi/DWpg71HJt24/maxresdefault.jpg") + }, + { + "nizard_1", ("https://youtu.be/1fjA68k8DAU?si=2PuZSquVQGvfmQkZ", + "https://img.youtube.com/vi/1fjA68k8DAU/maxresdefault.jpg") + }, }; /// /// Génère une liste d'artistes de musique en utilisant la bibliothèque Faker pour créer des noms d'artistes et des biographies réalistes. /// - /// Nombre d'artistes à générer - /// Liste d'artistes de musique générés + /// Nombre d'artistes à générer. + /// Liste d'artistes de musique générés. public List GenerateArtists(int count) { var artists = new List(); @@ -73,7 +90,7 @@ public class DataFactory IdArtiste = i + 1, Nom = Name.FullName(), Biographie = Lorem.Paragraph(), - Titres = new List() + Titres = new List(), }); } @@ -83,8 +100,8 @@ public class DataFactory /// /// Génère une liste de styles de musique à partir d'une liste prédéfinie de noms de styles. /// - /// Nombre de styles à générer (maximum 15, car il y a 15 styles prédéfinis) - /// Liste de styles de musique générés + /// Nombre de styles à générer (maximum 15, car il y a 15 styles prédéfinis). + /// Liste de styles de musique générés. public List