From a153fdd1730d874f8821f7bf88b7ab2cd2195e64 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 29 Aug 2026 20:43:25 -0700 Subject: [PATCH 01/10] Adopt the fleet LF line-ending default and renormalize the tree The hub moved the fleet default from CRLF-with-LF-exceptions to LF-with-a-CRLF-exception-for-bat-and-cmd. `.editorconfig` now declares `[*] end_of_line = lf` and `.gitattributes` declares `* text=auto eol=lf`, so git enforces the ending on checkout and renormalize rather than leaving it to the editor. The per-type LF pins those two files carried (`*.sh`, the husky hook, `uv.lock`, Dockerfiles, workflow YAML) are redundant under the new default and are dropped. `git add --renormalize .` converts the 160 tracked CRLF files to LF. Only `.editorconfig`, `.editorconfig-checker.json` and `.gitattributes` carry content changes; every other file in this commit is line-endings only, as `git diff --ignore-cr-at-eol` shows. The six binary files are untouched. --- .config/dotnet-tools.json | 54 +- .dockerignore | 74 +- .editorconfig | 489 +- .editorconfig-checker.json | 27 +- .gitattributes | 36 +- .github/ISSUE_TEMPLATE/bug_report.yml | 172 +- .github/ISSUE_TEMPLATE/config.yml | 10 +- .github/copilot-instructions.md | 668 +- .github/dependabot.yml | 86 +- .gitignore | 40 +- .husky/task-runner.json | 64 +- .markdownlint-cli2.jsonc | 36 +- .vscode/launch.json | 912 +-- .vscode/tasks.json | 802 +-- AGENTS.md | 204 +- ARCHITECTURE.md | 962 +-- AUDIT.md | 148 +- CODESTYLE.md | 156 +- Directory.Build.props | 28 +- Directory.Packages.props | 46 +- Docker/README.md | 70 +- Docs/ClosedCaptions.md | 372 +- Docs/CustomOptions.md | 212 +- Docs/LanguageMatching.md | 54 +- GOVERNANCE.md | 626 +- HISTORY.md | 916 +-- LICENSE | 42 +- OPERATIONS.md | 122 +- PlexCleaner.code-workspace | 100 +- PlexCleaner.defaults.json | 364 +- PlexCleaner.schema.json | 692 +- PlexCleaner.slnx | 166 +- PlexCleaner/AssemblyVersion.cs | 96 +- PlexCleaner/AudioProps.cs | 38 +- PlexCleaner/Bitrate.cs | 224 +- PlexCleaner/BitrateInfo.cs | 244 +- PlexCleaner/CommandLineOptions.cs | 984 +-- PlexCleaner/ConfigFileJsonSchema.cs | 708 +- PlexCleaner/Convert.cs | 370 +- PlexCleaner/ConvertOptions.cs | 326 +- PlexCleaner/DtsInfo.cs | 106 +- PlexCleaner/Extensions.cs | 58 +- PlexCleaner/FfMpegBuilder.cs | 556 +- PlexCleaner/FfMpegIdetInfo.cs | 528 +- PlexCleaner/FfMpegTool.cs | 1084 ++-- PlexCleaner/FfMpegToolJsonSchema.cs | 398 +- PlexCleaner/FfProbeBuilder.cs | 320 +- PlexCleaner/FfProbeTool.cs | 1004 +-- PlexCleaner/GitHubRelease.cs | 88 +- PlexCleaner/GlobalUsings.cs | 6 +- PlexCleaner/HandBrakeBuilder.cs | 346 +- PlexCleaner/HandBrakeTool.cs | 320 +- PlexCleaner/IProcessPlugin.cs | 82 +- PlexCleaner/JsonSerialization.cs | 134 +- PlexCleaner/KeepAwake.cs | 84 +- PlexCleaner/Language.cs | 62 +- PlexCleaner/LoggerFactory.cs | 220 +- PlexCleaner/MatroskaStructure.cs | 360 +- PlexCleaner/MediaInfoBuilder.cs | 184 +- PlexCleaner/MediaInfoTool.cs | 496 +- PlexCleaner/MediaInfoToolJsonSchema.cs | 212 +- PlexCleaner/MediaInfoToolXmlSchema.cs | 188 +- PlexCleaner/MediaInfoXmlParser.cs | 870 +-- PlexCleaner/MediaProps.cs | 478 +- PlexCleaner/MediaTool.cs | 1030 +-- PlexCleaner/MediaToolInfo.cs | 148 +- PlexCleaner/Metrics.cs | 466 +- PlexCleaner/MkvMergeBuilder.cs | 394 +- PlexCleaner/MkvMergeTool.cs | 674 +- PlexCleaner/MkvProcess.cs | 122 +- PlexCleaner/MkvPropEditBuilder.cs | 304 +- PlexCleaner/MkvPropEditTool.cs | 410 +- PlexCleaner/MkvToolJsonSchema.cs | 374 +- PlexCleaner/Monitor.cs | 638 +- PlexCleaner/PerFileLogLevel.cs | 166 +- PlexCleaner/PlexCleaner.csproj | 132 +- PlexCleaner/PluginLoader.cs | 238 +- PlexCleaner/Process.cs | 1292 ++-- PlexCleaner/ProcessDriver.cs | 1090 ++-- PlexCleaner/ProcessFile.cs | 5712 ++++++++--------- PlexCleaner/ProcessOptions.cs | 954 +-- PlexCleaner/ProcessResultJsonSchema.cs | 210 +- PlexCleaner/Program.cs | 1174 ++-- PlexCleaner/Properties/launchSettings.json | 238 +- PlexCleaner/SelectMediaProps.cs | 290 +- PlexCleaner/SevenZipBuilder.cs | 220 +- PlexCleaner/SevenZipTool.cs | 418 +- PlexCleaner/SidecarFile.cs | 1468 ++--- PlexCleaner/SidecarFileJsonSchema.cs | 654 +- PlexCleaner/SubtitleProps.cs | 326 +- PlexCleaner/TagMap.cs | 24 +- PlexCleaner/TagMapSet.cs | 278 +- PlexCleaner/ToolInfoJsonSchema.cs | 134 +- PlexCleaner/Tools.cs | 712 +- PlexCleaner/ToolsOptions.cs | 88 +- PlexCleaner/TrackProps.cs | 1610 ++--- PlexCleaner/VerifyClassifier.cs | 174 +- PlexCleaner/VerifyOptions.cs | 144 +- PlexCleaner/VerifyResult.cs | 26 +- PlexCleaner/VideoProps.cs | 488 +- PlexCleanerTests/.editorconfig | 20 +- PlexCleanerTests/ClosedCaptionsProbeTests.cs | 98 +- PlexCleanerTests/CommandLineTests.cs | 1118 ++-- PlexCleanerTests/ConfigFileTests.cs | 166 +- PlexCleanerTests/DefaultTrackFlagsTests.cs | 230 +- PlexCleanerTests/DtsInfoTests.cs | 232 +- PlexCleanerTests/FfMpegIdetDecisionTests.cs | 224 +- PlexCleanerTests/FfMpegIdetInfoSerializer.cs | 80 +- PlexCleanerTests/FfMpegIdetParsingTests.cs | 280 +- PlexCleanerTests/FfMpegNalUnitTests.cs | 50 +- PlexCleanerTests/FfProbeLogTests.cs | 118 +- PlexCleanerTests/MetricsTests.cs | 384 +- PlexCleanerTests/PerFileLogLevelTests.cs | 498 +- PlexCleanerTests/PlexCleanerFixture.cs | 354 +- PlexCleanerTests/PlexCleanerTests.csproj | 50 +- PlexCleanerTests/PluginLoaderTests.cs | 94 +- PlexCleanerTests/ProcessDriverTests.cs | 70 +- PlexCleanerTests/SidecarFileTests.cs | 168 +- PlexCleanerTests/StreamTimingsProbeTests.cs | 82 +- PlexCleanerTests/ToolFailureLogFormatTests.cs | 270 +- PlexCleanerTests/ToolProgressParsingTests.cs | 92 +- PlexCleanerTests/VerifyClassifierTests.cs | 176 +- PlexCleanerTests/VersionParsingTests.cs | 188 +- PlexCleanerTests/WildcardTests.cs | 36 +- .../DtsTimestampRepair.csproj | 20 +- .../DtsTimestampRepairPlugin.cs | 178 +- .../MatroskaCleanupPlugin.cs | 172 +- .../MatroskaHeaderCleanup.csproj | 20 +- README.md | 2216 +++---- RegressionTests/README.md | 370 +- RegressionTests/audit_physical.py | 226 +- RegressionTests/catalog_corpus.py | 196 +- RegressionTests/corpus_common.py | 744 +-- RegressionTests/locate_issue.py | 442 +- RegressionTests/pyproject.toml | 50 +- RegressionTests/reduce_corpus.py | 1044 +-- RegressionTests/reduction-rules.example.json | 54 +- RegressionTests/synthetic/hevc_nal.py | 176 +- RegressionTests/synthetic/inject_cc_sei.py | 110 +- .../synthetic/inject_hdr10plus_sei.py | 128 +- RegressionTests/synthetic/synthesize.py | 346 +- Samples/PlexCleaner/PlexCleaner.v1.json | 114 +- Samples/PlexCleaner/PlexCleaner.v2.json | 264 +- Samples/PlexCleaner/PlexCleaner.v3.json | 280 +- Samples/PlexCleaner/PlexCleaner.v4.json | 288 +- Samples/PlexCleaner/Sidecar.State.PlexCleaner | 26 +- Samples/PlexCleaner/Sidecar.v1.PlexCleaner | 22 +- Samples/PlexCleaner/Sidecar.v2.PlexCleaner | 22 +- Samples/PlexCleaner/Sidecar.v3.PlexCleaner | 22 +- Samples/PlexCleaner/Sidecar.v4.PlexCleaner | 24 +- Samples/PlexCleaner/Sidecar.v5.PlexCleaner | 26 +- Sandbox/Program.cs | 282 +- Sandbox/Sandbox.csproj | 24 +- Sandbox/TestSomething.cs | 16 +- WORKFLOW.md | 1132 ++-- codecov.yml | 32 +- cspell.json | 710 +- host-tools.json | 36 +- repo-config/README.md | 78 +- repo-config/develop.json | 122 +- repo-config/main.json | 116 +- repo-config/settings.json | 20 +- spec/secrets.json | 68 +- version.json | 20 +- 164 files changed, 29009 insertions(+), 29049 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 957373e9..3975ed52 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,27 +1,27 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "csharpier": { - "version": "1.3.0", - "commands": [ - "csharpier" - ], - "rollForward": false - }, - "husky": { - "version": "0.9.1", - "commands": [ - "husky" - ], - "rollForward": false - }, - "dotnet-outdated-tool": { - "version": "4.8.1", - "commands": [ - "dotnet-outdated" - ], - "rollForward": false - } - } -} +{ + "version": 1, + "isRoot": true, + "tools": { + "csharpier": { + "version": "1.3.0", + "commands": [ + "csharpier" + ], + "rollForward": false + }, + "husky": { + "version": "0.9.1", + "commands": [ + "husky" + ], + "rollForward": false + }, + "dotnet-outdated-tool": { + "version": "4.8.1", + "commands": [ + "dotnet-outdated" + ], + "rollForward": false + } + } +} diff --git a/.dockerignore b/.dockerignore index 45141c8f..44ceb9da 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,37 +1,37 @@ -# .NET build artifacts -**/bin/ -**/obj/ -**/out/ -.artifacts/ -**/.artifacts/ - -# Visual Studio / VS Code -.vs/ -.vscode/ -*.user -*.suo -*.userosscache -*.sln.docstates - -# Test results -TestResults/ -**/TestResults/ - -# NuGet packages -*.nupkg -*.snupkg -packages/ - -# Git -.git/ -.gitignore -.gitattributes - -# CI/CD -.github/ -.codex - -# Other -*.log -*.tmp -*.cache +# .NET build artifacts +**/bin/ +**/obj/ +**/out/ +.artifacts/ +**/.artifacts/ + +# Visual Studio / VS Code +.vs/ +.vscode/ +*.user +*.suo +*.userosscache +*.sln.docstates + +# Test results +TestResults/ +**/TestResults/ + +# NuGet packages +*.nupkg +*.snupkg +packages/ + +# Git +.git/ +.gitignore +.gitattributes + +# CI/CD +.github/ +.codex + +# Other +*.log +*.tmp +*.cache diff --git a/.editorconfig b/.editorconfig index 2bea93b3..3e63e3a6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,257 +1,232 @@ -# https://editorconfig.org - -# https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names -# https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions -# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview - -# https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md -# https://github.com/dotnet/runtime/blob/main/.editorconfig - -# https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format -# Verify with: dotnet format style --verify-no-changes --severity=info --verbosity=detailed - -# Root config -root = true - -# Defaults: CRLF is the default, and only the LF exceptions below are declared. -# Most LF pins are shared with `.gitattributes`, which git enforces: `*.sh`, the husky pre-commit shebang, `uv.lock`, and Dockerfiles. -# The workflow-YAML pin (`.github/workflows/*`) is `.editorconfig`-only. -# For those, git stays passive (`* -text`) and CI (editorconfig-checker) enforces LF. -# Keep the `[*]` `end_of_line = crlf` default, which the Windows-GUI and WSL-engine workflow requires because Windows tooling misbehaves on LF. -# Every uncovered file type relies on that default too. -[*] -charset = utf-8 -end_of_line = crlf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -# Markdown files -[*.md] -trim_trailing_whitespace = false - -# Xml files -[*.{xml,csproj,props,targets}] -indent_size = 2 - -# Yaml files -[*.{yml,yaml}] -indent_size = 2 - -# Workflow YAML is LF, because Dependabot and Actions rewrite it with LF, so declaring LF keeps it consistent instead of mixed. -# Endings are still left alone by git (`* -text`), and this file plus CI (editorconfig-checker) enforce it. -# Other YAML stays CRLF. -[.github/workflows/*.{yml,yaml}] -end_of_line = lf - -# This repository's own hook, paired with the `.gitattributes` pin. -# The git pin alone leaves the editor free to write a CRLF shebang, which would break it. -[.husky/pre-commit] -end_of_line = lf - -# Linux scripts -[*.sh] -end_of_line = lf - -# The uv tool regenerates uv.lock with LF on every platform, so pin it here. -# Without the pin an EOL check (editorconfig-checker or CI) fails on every `uv lock` or `uv sync` until the file is manually reconverted. -# The rationale matches the shebang and Dockerfile pins, where a tool owns the ending. -# A Python repo on the CRLF default carries this, and a repo with no lockfile is unaffected. -[uv.lock] -end_of_line = lf - -# Dockerfiles are LF, because CRLF breaks RUN heredocs and line continuations. -[{Dockerfile,*.Dockerfile}] -end_of_line = lf - -# .NET-only below, covering C# and ReSharper style. -# Everything above is the line-ending governance every derived repo carries. - -# C# files -[*.cs] -# Suppressions follow CODESTYLE.md "Analyzer Diagnostics and Suppressions". -# Prefer a [SuppressMessage] attribute, or the owning project's .editorconfig. -# Relax a rule repo-wide here only when it applies to every project, never for a brownfield batch. -dotnet_diagnostic.IDE0055.severity = none -dotnet_analyzer_diagnostic.severity = suggestion - -# Repo-wide CA relaxations that apply to every project here, since PlexCleaner is a console app rather than a reusable library. -# Public API surface rules do not apply to a console app. -dotnet_diagnostic.CA1002.severity = none # Do not expose List -dotnet_diagnostic.CA1024.severity = none # Use properties where appropriate -dotnet_diagnostic.CA1034.severity = none # Nested types should not be visible -dotnet_diagnostic.CA1052.severity = none # Static holder types (builder pattern uses partial classes) -dotnet_diagnostic.CA1055.severity = none # URI return values should not be strings -dotnet_diagnostic.CA1056.severity = none # URI properties should not be strings -dotnet_diagnostic.CA1062.severity = none # Validate parameters of public methods -dotnet_diagnostic.CA1515.severity = none # Consider making public types internal -dotnet_diagnostic.CA1724.severity = none # Type names should not match namespaces -dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only - -# Console app context: no localization, no SynchronizationContext, intentional case usage -dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters -dotnet_diagnostic.CA1307.severity = none # Specify StringComparison for clarity -dotnet_diagnostic.CA1308.severity = none # Normalize strings to uppercase (code intentionally lowercases) -dotnet_diagnostic.CA2007.severity = none # ConfigureAwait (console app has no SynchronizationContext) -dotnet_diagnostic.CA2234.severity = none # Pass System.Uri instead of string - -# False positives or inapplicable in this codebase -dotnet_diagnostic.CA1508.severity = none # Dead code (false positive with ??= pattern) -dotnet_diagnostic.CA5392.severity = none # DefaultDllImportSearchPaths (limited intentional P/Invoke, risk accepted) -csharp_indent_block_contents = true -csharp_indent_braces = false -csharp_indent_case_contents = true -csharp_indent_case_contents_when_block = false -csharp_indent_labels = one_less_than_current -csharp_indent_switch_labels = true -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 -csharp_prefer_braces = true -csharp_prefer_simple_default_expression = true -csharp_prefer_simple_using_statement = true -csharp_prefer_static_anonymous_function = true -csharp_prefer_static_local_function = true -csharp_prefer_system_threading_lock = true -csharp_preferred_modifier_order = public,private,protected,internal,file,static,abstract,sealed,virtual,override,readonly,unsafe,volatile,async,extern,new,partial:warning -csharp_preserve_single_line_blocks = true -csharp_preserve_single_line_statements = false -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 -csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true -csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true -csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true -csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true -csharp_style_allow_embedded_statements_on_same_line_experimental = true -csharp_style_conditional_delegate_call = true -csharp_style_deconstructed_variable_declaration = true -csharp_style_expression_bodied_accessors = true -csharp_style_expression_bodied_constructors = true -csharp_style_expression_bodied_indexers = true -csharp_style_expression_bodied_lambdas = true -csharp_style_expression_bodied_local_functions = true -csharp_style_expression_bodied_methods = true -csharp_style_expression_bodied_operators = true -csharp_style_expression_bodied_properties = true -csharp_style_implicit_object_creation_when_type_is_apparent = true -csharp_style_inlined_variable_declaration = true -csharp_style_namespace_declarations = file_scoped -csharp_style_pattern_matching_over_as_with_null_check = true -csharp_style_pattern_matching_over_is_with_cast_check = true -csharp_style_prefer_extended_property_pattern = true -csharp_style_prefer_implicitly_typed_lambda_expression = true -csharp_style_prefer_index_operator = true -csharp_style_prefer_local_over_anonymous_function = true -csharp_style_prefer_method_group_conversion = true -csharp_style_prefer_not_pattern = true -csharp_style_prefer_null_check_over_type_check = true -csharp_style_prefer_pattern_matching = true -csharp_style_prefer_primary_constructors = true -csharp_style_prefer_range_operator = true -csharp_style_prefer_readonly_struct = true -csharp_style_prefer_readonly_struct_member = true -csharp_style_prefer_switch_expression = true -csharp_style_prefer_top_level_statements = true -csharp_style_prefer_tuple_swap = true -csharp_style_prefer_unbound_generic_type_in_nameof = true -csharp_style_prefer_utf8_string_literals = true -csharp_style_throw_expression = true -csharp_style_unused_value_assignment_preference = discard_variable -csharp_style_unused_value_expression_statement_preference = discard_variable -csharp_style_var_elsewhere = false -csharp_style_var_for_built_in_types = false -csharp_style_var_when_type_is_apparent = false -csharp_using_directive_placement = outside_namespace -dotnet_code_quality_unused_parameters = all -dotnet_hide_advanced_members = false -dotnet_member_insertion_location = with_other_members_of_the_same_kind -dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion -dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style -dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields -dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style -dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields -dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion -dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style -dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields -dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case -dotnet_naming_style.camel_case_underscore_style.required_prefix = _ -dotnet_naming_style.pascal_case_style.capitalization = pascal_case -dotnet_naming_style.static_prefix_style.capitalization = camel_case -dotnet_naming_style.static_prefix_style.required_prefix = s_ -dotnet_naming_symbols.constant_fields.applicable_kinds = field -dotnet_naming_symbols.constant_fields.required_modifiers = const -dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal -dotnet_naming_symbols.private_internal_fields.applicable_kinds = field -dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected -dotnet_naming_symbols.static_fields.applicable_kinds = field -dotnet_naming_symbols.static_fields.required_modifiers = static -dotnet_prefer_system_hash_code = true -dotnet_property_generation_behavior = prefer_throwing_properties -dotnet_remove_unnecessary_suppression_exclusions = none -dotnet_search_reference_assemblies = true -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = true -dotnet_style_allow_multiple_blank_lines_experimental = true -dotnet_style_allow_statement_immediately_after_block_experimental = true -dotnet_style_coalesce_expression = true -dotnet_style_collection_initializer = true -dotnet_style_explicit_tuple_names = true -dotnet_style_namespace_match_folder = true -dotnet_style_null_propagation = true -dotnet_style_object_initializer = true -dotnet_style_operator_placement_when_wrapping = beginning_of_line -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity -dotnet_style_parentheses_in_other_operators = never_if_unnecessary -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity -dotnet_style_predefined_type_for_locals_parameters_members = true -dotnet_style_predefined_type_for_member_access = true -dotnet_style_prefer_auto_properties = true -dotnet_style_prefer_collection_expression = when_types_loosely_match -dotnet_style_prefer_compound_assignment = true -dotnet_style_prefer_conditional_expression_over_assignment = true -dotnet_style_prefer_conditional_expression_over_return = true -dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed -dotnet_style_prefer_inferred_anonymous_type_member_names = true -dotnet_style_prefer_inferred_tuple_names = true -dotnet_style_prefer_is_null_check_over_reference_equality_method = true -dotnet_style_prefer_simplified_boolean_expressions = true -dotnet_style_prefer_simplified_interpolation = true -dotnet_style_qualification_for_event = false -dotnet_style_qualification_for_field = false -dotnet_style_qualification_for_method = false -dotnet_style_qualification_for_property = false -dotnet_style_readonly_field = true -dotnet_style_require_accessibility_modifiers = for_non_interface_members - -# ReSharper settings -resharper_csharp_trailing_comma_in_multiline_lists = true -resharper_csharp_var_for_built_in_types = false -resharper_csharp_var_when_type_is_apparent = false -resharper_csharp_var_when_type_is_not_apparent = false +# https://editorconfig.org + +# https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names +# https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions +# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview + +# https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md +# https://github.com/dotnet/runtime/blob/main/.editorconfig + +# https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format +# Verify with: dotnet format style --verify-no-changes --severity=info --verbosity=detailed + +# Root config +root = true + +# Defaults: LF is the default, and only the CRLF exception below is declared. +# `.gitattributes` mirrors these two defaults as Git's normalization fallback. +# CI verifies the committed bytes against this file. +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +# Markdown files +[*.md] +trim_trailing_whitespace = false + +# Xml files +[*.{xml,csproj,props,targets}] +indent_size = 2 + +# Yaml files +[*.{yml,yaml}] +indent_size = 2 + +# Windows batch and command scripts: the one CRLF exception to the `[*]` LF default above. +[*.{bat,cmd}] +end_of_line = crlf + +# .NET-only below, covering C# and ReSharper style. +# Everything above is the line-ending governance every derived repo carries, and a non-.NET repo carries this section unused, per CODESTYLE.md's whole-file model. + +# C# files +[*.cs] +# Suppressions follow CODESTYLE.md "Analyzer Diagnostics and Suppressions". +# Prefer a [SuppressMessage] attribute, or the owning project's .editorconfig. +# Relax a rule repo-wide here only when it applies to every project, never for a brownfield batch. +dotnet_diagnostic.IDE0055.severity = none +dotnet_analyzer_diagnostic.severity = suggestion + +# Repo-wide CA relaxations that apply to every project here, since PlexCleaner is a console app rather than a reusable library. +# Public API surface rules do not apply to a console app. +dotnet_diagnostic.CA1002.severity = none # Do not expose List +dotnet_diagnostic.CA1024.severity = none # Use properties where appropriate +dotnet_diagnostic.CA1034.severity = none # Nested types should not be visible +dotnet_diagnostic.CA1052.severity = none # Static holder types (builder pattern uses partial classes) +dotnet_diagnostic.CA1055.severity = none # URI return values should not be strings +dotnet_diagnostic.CA1056.severity = none # URI properties should not be strings +dotnet_diagnostic.CA1062.severity = none # Validate parameters of public methods +dotnet_diagnostic.CA1515.severity = none # Consider making public types internal +dotnet_diagnostic.CA1724.severity = none # Type names should not match namespaces +dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only + +# Console app context: no localization, no SynchronizationContext, intentional case usage +dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters +dotnet_diagnostic.CA1307.severity = none # Specify StringComparison for clarity +dotnet_diagnostic.CA1308.severity = none # Normalize strings to uppercase (code intentionally lowercases) +dotnet_diagnostic.CA2007.severity = none # ConfigureAwait (console app has no SynchronizationContext) +dotnet_diagnostic.CA2234.severity = none # Pass System.Uri instead of string + +# False positives or inapplicable in this codebase +dotnet_diagnostic.CA1508.severity = none # Dead code (false positive with ??= pattern) +dotnet_diagnostic.CA5392.severity = none # DefaultDllImportSearchPaths (limited intentional P/Invoke, risk accepted) +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true +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 +csharp_prefer_braces = true +csharp_prefer_simple_default_expression = true +csharp_prefer_simple_using_statement = true +csharp_prefer_static_anonymous_function = true +csharp_prefer_static_local_function = true +csharp_prefer_system_threading_lock = true +csharp_preferred_modifier_order = public,private,protected,internal,file,static,abstract,sealed,virtual,override,readonly,unsafe,volatile,async,extern,new,partial:warning +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false +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 +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true +csharp_style_allow_embedded_statements_on_same_line_experimental = true +csharp_style_conditional_delegate_call = true +csharp_style_deconstructed_variable_declaration = true +csharp_style_expression_bodied_accessors = true +csharp_style_expression_bodied_constructors = true +csharp_style_expression_bodied_indexers = true +csharp_style_expression_bodied_lambdas = true +csharp_style_expression_bodied_local_functions = true +csharp_style_expression_bodied_methods = true +csharp_style_expression_bodied_operators = true +csharp_style_expression_bodied_properties = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_namespace_declarations = file_scoped +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_implicitly_typed_lambda_expression = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_local_over_anonymous_function = true +csharp_style_prefer_method_group_conversion = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_null_check_over_type_check = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_primary_constructors = true +csharp_style_prefer_range_operator = true +csharp_style_prefer_readonly_struct = true +csharp_style_prefer_readonly_struct_member = true +csharp_style_prefer_switch_expression = true +csharp_style_prefer_top_level_statements = true +csharp_style_prefer_tuple_swap = true +csharp_style_prefer_unbound_generic_type_in_nameof = true +csharp_style_prefer_utf8_string_literals = true +csharp_style_throw_expression = true +csharp_style_unused_value_assignment_preference = discard_variable +csharp_style_unused_value_expression_statement_preference = discard_variable +csharp_style_var_elsewhere = false +csharp_style_var_for_built_in_types = false +csharp_style_var_when_type_is_apparent = false +csharp_using_directive_placement = outside_namespace +dotnet_code_quality_unused_parameters = all +dotnet_hide_advanced_members = false +dotnet_member_insertion_location = with_other_members_of_the_same_kind +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion +dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style +dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.pascal_case_style.capitalization = pascal_case +dotnet_naming_style.static_prefix_style.capitalization = camel_case +dotnet_naming_style.static_prefix_style.required_prefix = s_ +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static +dotnet_prefer_system_hash_code = true +dotnet_property_generation_behavior = prefer_throwing_properties +dotnet_remove_unnecessary_suppression_exclusions = none +dotnet_search_reference_assemblies = true +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true +dotnet_style_allow_multiple_blank_lines_experimental = true +dotnet_style_allow_statement_immediately_after_block_experimental = true +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_operators = never_if_unnecessary +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity +dotnet_style_predefined_type_for_locals_parameters_members = true +dotnet_style_predefined_type_for_member_access = true +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_collection_expression = when_types_loosely_match +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = true +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true +dotnet_style_qualification_for_event = false +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false +dotnet_style_qualification_for_property = false +dotnet_style_readonly_field = true +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# ReSharper settings +resharper_csharp_trailing_comma_in_multiline_lists = true +resharper_csharp_var_for_built_in_types = false +resharper_csharp_var_when_type_is_apparent = false +resharper_csharp_var_when_type_is_not_apparent = false diff --git a/.editorconfig-checker.json b/.editorconfig-checker.json index e019960b..a3478e97 100644 --- a/.editorconfig-checker.json +++ b/.editorconfig-checker.json @@ -1,10 +1,17 @@ -{ - "Disable": { - "Charset": true, - "Indentation": true, - "IndentSize": true, - "TrimTrailingWhitespace": true, - "InsertFinalNewline": true, - "MaxLineLength": true - } -} +{ + "Exclude": [ + "(^|/)__pycache__/", + "(^|/)\\.mypy_cache/", + "(^|/)\\.pytest_cache/", + "(^|/)\\.ruff_cache/", + "(^|/)\\.venv/" + ], + "Disable": { + "Charset": true, + "Indentation": true, + "IndentSize": true, + "TrimTrailingWhitespace": true, + "InsertFinalNewline": true, + "MaxLineLength": true + } +} diff --git a/.gitattributes b/.gitattributes index a4cb45ca..efb6dddb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,29 +1,7 @@ -# Default: git does not normalize line endings (`* -text`), and .editorconfig end_of_line rules guide what the editor writes. -# The exception pins below are git's own enforcement, forcing LF for execution-sensitive classes regardless of editor. -# Configure with: git config --global core.autocrlf false -# Renormalize with: git add --renormalize . -# Inspect with: git ls-files --eol -* -text - -# Exception: scripts must stay LF regardless of the `* -text` default, because a CRLF shebang breaks execution. -# `.editorconfig` covers `*.sh`, but an extensionless executable matches no extension rule. -# Pin those here, so git enforces LF on checkout and on `--renormalize`. -# Any repo whose tooling ships extensionless scripts adds the matching path pin. -# The s6-overlay init is `Docker/s6-overlay/** text eol=lf`, and a husky or git hook is `.husky/pre-commit text eol=lf`. -*.sh text eol=lf -# This repository's own hook, which is the extensionless case the comment above names. -.husky/pre-commit text eol=lf - -# Vanilla `.py` follows the CRLF default, since Python's universal newlines accept CRLF and it is commonly edited on Windows. -# Pin LF only for a `.py` executed directly via its shebang, by path. -# This repo has none, since the RegressionTests tooling is run as `python3