Skip to content

Commit

Permalink
formatting and packages (#238)
Browse files Browse the repository at this point in the history
* formatting and packages

* precommit fixes

* devcontainer
  • Loading branch information
f2calv authored Nov 21, 2024
1 parent 6f041c6 commit ee855d7
Show file tree
Hide file tree
Showing 19 changed files with 106 additions and 51 deletions.
47 changes: 26 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "C# (.NET)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// "portsAttributes": {
// "5001": {
// "protocol": "https"
// }
// }
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sh . ./.devcontainer/postCreateCommand.sh",
"postStartCommand": "sh . ./.devcontainer/postStartCommand.sh",
// Configure tool-specific properties.
// "customizations": {},
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
"name": "C# (.NET)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// "portsAttributes": {
// "5001": {
// "protocol": "https"
// }
// }
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sh . ./.devcontainer/postCreateCommand.sh",
"postStartCommand": "sh . ./.devcontainer/postStartCommand.sh",
// Configure tool-specific properties.
// "customizations": {},
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/source/github,target=/workspaces,type=bind,consistency=cached",
"source=${env:HOME}${env:USERPROFILE}/.kube,target=/home/vscode/.kube,type=bind"
]
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-xml
- id: check-yaml
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<RootNamespace>CasCap</RootNamespace>
<LangVersion>12.0</LangVersion>
<LangVersion>13.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<!--nullable we enable on a per project basis-->
<!--<Nullable>enable</Nullable>-->
<UserSecretsId>b08b24aa-70ab-4ecd-aef9-cce6d49054ec</UserSecretsId>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup>
Expand Down
38 changes: 38 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>

<PackageVersion Include="AzurePipelinesToGitHubActionsConverter.Core" Version="1.3.39" />
<PackageVersion Include="CasCap.Common.Extensions" Version="4.2.2" />
<PackageVersion Include="CasCap.Common.Net" Version="4.2.2" />
<PackageVersion Include="CasCap.Common.Testing" Version="4.2.2" />
<PackageVersion Include="ConsoleTables" Version="2.6.2" />
<PackageVersion Include="Figgle" Version="0.5.1" />
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageVersion Include="McMaster.Extensions.Hosting.CommandLine" Version="4.1.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.TeamFoundation.DistributedTask.WebApi" Version="19.225.1" />
<PackageVersion Include="Microsoft.TeamFoundationServer.Client" Version="19.225.1" />
<PackageVersion Include="Microsoft.VisualStudio.Services.Client" Version="19.225.1" />
<PackageVersion Include="Microsoft.VisualStudio.Services.Release.Client" Version="19.225.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="ShellProgressBar" Version="5.2.0" />
<PackageVersion Include="YamlDotNet" Version="16.2.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="semver" Version="3.0.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />

</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CasCap.Common.Testing" Version="4.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="CasCap.Common.Testing" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.Apis.AzureDevOps.Tests/Tests/ApiServiceTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Diagnostics;
using Xunit;
using Xunit.Abstractions;

namespace CasCap.Apis.AzureDevOps.Tests;

public class ApiServiceTests : TestBase
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.Apis.AzureDevOps.Tests/Tests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Xunit.Abstractions;

namespace CasCap.Apis.AzureDevOps.Tests;

public abstract class TestBase
Expand Down
20 changes: 10 additions & 10 deletions src/CasCap.Apis.AzureDevOps/CasCap.Apis.AzureDevOps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AzurePipelinesToGitHubActionsConverter.Core" Version="1.3.39" />
<PackageReference Include="CasCap.Common.Extensions" Version="4.2.2" />
<PackageReference Include="CasCap.Common.Net" Version="4.2.2" />
<PackageReference Include="Microsoft.TeamFoundation.DistributedTask.WebApi" Version="19.225.1" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="19.225.1" />
<PackageReference Include="Microsoft.VisualStudio.Services.Client" Version="19.225.1" />
<PackageReference Include="Microsoft.VisualStudio.Services.Release.Client" Version="19.225.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="semver" Version="3.0.0" />
<PackageReference Include="YamlDotNet" Version="16.2.0" />
<PackageReference Include="AzurePipelinesToGitHubActionsConverter.Core" />
<PackageReference Include="CasCap.Common.Extensions" />
<PackageReference Include="CasCap.Common.Net" />
<PackageReference Include="Microsoft.TeamFoundation.DistributedTask.WebApi" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" />
<PackageReference Include="Microsoft.VisualStudio.Services.Client" />
<PackageReference Include="Microsoft.VisualStudio.Services.Release.Client" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="semver" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/CasCap.Apis.AzureDevOps/Models/Yaml/Pipeline.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AzurePipelinesToGitHubActionsConverter.Core.AzurePipelines;
using CasCap.Utilities;
using YamlDotNet.Serialization;

namespace CasCap.Models;

public class Pipeline
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.Apis.AzureDevOps/Models/Yaml/StageAzDO.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using AzurePipelinesToGitHubActionsConverter.Core.AzurePipelines;

namespace CasCap.Models;

public class StageAzDO// : Stage //we can't inherit from Stage here as it will mess up the order of the properties when YAMLised.
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.Apis.AzureDevOps/Models/Yaml/Template.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.TeamFoundation.DistributedTask.WebApi;
using YamlDotNet.Serialization;

namespace CasCap.Models;

public class Template : Pipeline
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.Apis.AzureDevOps/Models/Yaml/TriggerAzDO.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using AzurePipelinesToGitHubActionsConverter.Core.AzurePipelines;

namespace CasCap.Models;

public class TriggerAzDO : Trigger
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.Apis.AzureDevOps/Services/ApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.Extensions.Logging;
using System.Net.Http.Headers;
using System.Text;

namespace CasCap.Services;

public interface IApiService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using YamlDotNet.Core;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.EventEmitters;

namespace CasCap.Utilities;

public class LiteralMultilineEventEmitter : ChainedEventEmitter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Collections.Concurrent;
using System.Text;
using System.Text.RegularExpressions;

namespace CasCap.Utilities;

public class YamlPipelineGenerator
Expand Down
14 changes: 7 additions & 7 deletions src/CasCap.DevOpsYamlizrCli/CasCap.DevOpsYamlizrCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ConsoleTables" Version="2.6.2" />
<PackageReference Include="Figgle" Version="0.5.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="McMaster.Extensions.Hosting.CommandLine" Version="4.1.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
<PackageReference Include="ConsoleTables" />
<PackageReference Include="Figgle" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" />
<PackageReference Include="McMaster.Extensions.Hosting.CommandLine" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="ShellProgressBar" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.DevOpsYamlizrCli/Commands/CommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.VisualStudio.Services.WebApi;
using ShellProgressBar;
using System.Diagnostics;

namespace CasCap.Commands;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.DevOpsYamlizrCli/Commands/GenerateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Collections.Concurrent;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;

namespace CasCap.Commands;

[Command(Description = "Generate Azure DevOps YAML pipelines from classic definitions.")]
Expand Down
1 change: 1 addition & 0 deletions src/CasCap.DevOpsYamlizrCli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using McMaster.Extensions.CommandLineUtils;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace CasCap;

[Command("yamlizr")]
Expand Down

0 comments on commit ee855d7

Please sign in to comment.