Directory.Packages.props with more complex PackageReference does not execute regex replace

オープン
#602 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp
領域
tooling

調査の方向性

Start with the regex in src/DotNetOutdated.Core/Services/CentralPackageVersionManagementService.cs (around line 47), which matches the version inside a GlobalPackageReference element. Reproduce with a Directory.Packages.props where that element spans several lines with nested PrivateAssets and IncludeAssets children, then compare it with the single-line workaround in the issue. Done when the multi-line form is updated to the latest version and the single-line form still works.

索引モデルが issue の本文から書いたものです。

説明

When using (global) Central Package Management via Directory.Packages.props and the <GlobalPackageReference line in question is not a simple single line with self-closing tag /> (such as when specifying controlling assets use-case) the dotnet outdated -u command does correctly recognize the nugets to update, and runs through the process to completion, however does not actually update the Directory.Packages.props file contents.

Without digging to much into this codebase, I am assuming the issue is with Regex here perhaps


Edit: after playing around with the regex, seems a potentially temporary workaround is to put everything on the same line and mark end of line with comment of closing tag it is looking for, such as:

<GlobalPackageReference Include="coverlet.collector" Version="6.0.0"><PrivateAssets>all</PrivateAssets><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets></GlobalPackageReference><!-- /> -->

then the update completes successfully, changing to latest version 6.0.2 properly

主要言語
C#
スター
1.7k
フォーク
172
平均マージ
1日 19時間
マージ済み PR(30日)
39

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet-outdated/dotnet-outdated のほかの issue

dotnet-outdated/dotnet-outdated の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。