Skip to content

Commit

Permalink
Merge pull request #13 from EduardoHDCorrea/issue/11
Browse files Browse the repository at this point in the history
Correção de listagem incorreta de projetos e pacotes alterados no comando "resumir-pr".
  • Loading branch information
EduardoHDCorrea authored Jan 20, 2025
2 parents 31ff6ff + a66a36f commit cc1dd28
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
11 changes: 7 additions & 4 deletions src/Ferramentas.Cli/Domínio/ResumirPr/ResumirPrComando.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,18 @@ string[] identificadores
QuantidadeDeAlterações = 1
};

var projetoÉTeste = detalhesDoProjeto.NomeDoProjeto.Contains(
var projetoEhTeste = detalhesDoProjeto.NomeDoProjeto.Contains(
"Tests",
StringComparison.InvariantCultureIgnoreCase
);

if (projetoÉTeste)
if (projetoEhTeste)
detalhesDoProjeto.TipoDoProjeto = TipoDoProjeto.Testes;

try
{
var conteúdoDoArquivo = File.ReadAllText(projetoDoArquivo);
if (conteúdoDoArquivo.Contains("<Version>"))
var conteúdoDoArquivo = File.ReadAllLines(projetoDoArquivo);
if (conteúdoDoArquivo.Any(x => x.Contains("<Version>")))
detalhesDoProjeto.TipoDoProjeto = TipoDoProjeto.Pacote;
}
catch
Expand Down Expand Up @@ -367,6 +367,9 @@ private static List<string> ObterArquivosAlteradosDoCommit(string hashDoCommit,

private static string? ObterProjetoDoArquivo(string caminhoDoArquivo, string caminhoDoRepositório)
{
if (caminhoDoArquivo.EndsWith(".csproj"))
return Path.GetFullPath(caminhoDoArquivo, caminhoDoRepositório);

var diretórioDoArquivo = Path.GetDirectoryName(caminhoDoArquivo);
if (diretórioDoArquivo is null)
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/Ferramentas.Cli/Ferramentas.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<LicenseUrl>https://opensource.org/licenses/MIT</LicenseUrl>
<RepositoryUrl>https://github.com/EduardoHDCorrea/Ferramentas</RepositoryUrl>
<ToolCommandName>skyinfo</ToolCommandName>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
<Authors>EduardoHDCorrea</Authors>
<Description>Ferramenta de CLI para facilitar alguns trabalhos repetitivos no setor.</Description>
<PackageOutputPath>./nupkg</PackageOutputPath>
Expand All @@ -23,7 +23,7 @@
<PackageReference Include="TextCopy" Version="6.2.1" />
<PackageReference Include="ToMarkdownTable" Version="0.2.0" />
</ItemGroup>

<ItemGroup>
<None Include="pull-request-template.md" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always"/>
<None Include="README.md" Pack="true" PackagePath="\"/>
Expand Down
1 change: 1 addition & 0 deletions src/Ferramentas.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static void Main(string[] args)
.WithAlias("cr");
}
);

app.Run(args);
}
}
7 changes: 1 addition & 6 deletions src/Ferramentas.Cli/pull-request-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

{{EstadoAfetado}}

## Comportamentos introduzidos, alterados, ou removidos:

> Descrição de comportamentos introduzidos, alterados, ou removidos. Por exemplo, a criação de um novo endpoint, a
> alteração de um comportamento de um comando existente, ou a remoção de um serviço.
## Comportamentos introduzidos, alterados, ou removidos:

{{Comportamentos}}

Expand All @@ -15,8 +12,6 @@

## Endpoints afetados:

> Lista de endpoints afetados pelo PR. Por exemplo, `/NotasDeServico`, `/Usuarios`, ou `/Organizacoes`.
{{Endpoint}}

## Procedimento de teste realizado:
Expand Down

0 comments on commit cc1dd28

Please sign in to comment.