Skip to content

Commit 63bf1ab

Browse files
committed
style: Apply CSharpier formatting to all source files
- Fix missing newlines at end of files throughout codebase - Standardize indentation and spacing in constructors - Align parameter formatting and method call formatting - Update XML project file indentation - Apply consistent formatting to interfaces and implementations - All 91 files reformatted for code style consistency
1 parent 71c6b92 commit 63bf1ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+524
-350
lines changed

src/.idea/.idea.port/.idea/indexLayout.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.port/.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.src.dir/.idea/indexLayout.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.src.dir/.idea/projectSettingsUpdater.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Config/Config.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ public ImageConfig GetImageConfigByIdentifier(string identifier)
1111
var imageConfig = ImageConfigs.SingleOrDefault(e => e.Identifier == identifier);
1212
if (imageConfig == null)
1313
{
14-
throw new ArgumentException($"There is no config defined for identifier '{identifier}'",
15-
nameof(identifier));
14+
throw new ArgumentException(
15+
$"There is no config defined for identifier '{identifier}'",
16+
nameof(identifier)
17+
);
1618
}
1719

1820
return imageConfig;
@@ -26,4 +28,4 @@ public class ImageConfig
2628
public List<string> Ports { get; set; } = new();
2729
public List<string> Environment { get; set; } = new();
2830
}
29-
}
31+
}

src/Config/Config10.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ public ImageConfig GetImageByImageName(string imageName)
1111
var imageConfig = Images.SingleOrDefault(e => e.ImageName == imageName);
1212
if (imageConfig == null)
1313
{
14-
throw new ArgumentException($"There is no config defined for imageName '{imageName}'",
15-
nameof(imageName));
14+
throw new ArgumentException(
15+
$"There is no config defined for imageName '{imageName}'",
16+
nameof(imageName)
17+
);
1618
}
1719

1820
return imageConfig;
@@ -23,18 +25,20 @@ public ImageConfig GetImageConfigByIdentifier(string identifier)
2325
var imageConfig = Images.SingleOrDefault(e => e.Identifier == identifier);
2426
if (imageConfig == null)
2527
{
26-
throw new ArgumentException($"There is no config defined for identifier '{identifier}'",
27-
nameof(identifier));
28+
throw new ArgumentException(
29+
$"There is no config defined for identifier '{identifier}'",
30+
nameof(identifier)
31+
);
2832
}
2933

3034
return imageConfig;
3135
}
32-
36+
3337
public class ImageConfig
3438
{
3539
public string Identifier { get; set; } = null!;
3640
public string ImageName { get; set; } = null!;
3741
public string ImageTag { get; set; } = null!;
3842
public List<string> Ports { get; set; } = new();
3943
}
40-
}
44+
}

src/Config/ConfigFactory.cs

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static Config GetOrCreateConfig()
1414
var configFilePath = GetConfigFilePath();
1515

1616
RenameIfNecessary(configFilePath);
17-
17+
1818
if (File.Exists(configFilePath))
1919
{
2020
MigrateIfNecessary(configFilePath);
@@ -59,7 +59,10 @@ private static void MigrateIfNecessary(string path)
5959
{
6060
case Versions.V10:
6161
var yaml = File.ReadAllText(path);
62-
PersistConfig(ConfigMigrations.Migrate10To11(serializer.Deserialize<Config10>(yaml)), path);
62+
PersistConfig(
63+
ConfigMigrations.Migrate10To11(serializer.Deserialize<Config10>(yaml)),
64+
path
65+
);
6366
break;
6467
case Versions.V11:
6568
break;
@@ -75,32 +78,24 @@ private static Config LoadConfig(string path)
7578
return serializer.Deserialize<Config>(yaml);
7679
}
7780

78-
private static Config CreateDefault() => new Config
79-
{
80-
DockerEndpoint = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
81-
? "npipe://./pipe/docker_engine"
82-
: "unix:///var/run/docker.sock",
83-
ImageConfigs = new List<Config.ImageConfig>
81+
private static Config CreateDefault() =>
82+
new Config
8483
{
85-
new()
84+
DockerEndpoint = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
85+
? "npipe://./pipe/docker_engine"
86+
: "unix:///var/run/docker.sock",
87+
ImageConfigs = new List<Config.ImageConfig>
8688
{
87-
Identifier = "Getting.Started",
88-
ImageName = "docker/getting-started",
89-
ImageTags = new List<string>
90-
{
91-
"latest"
92-
},
93-
Ports = new List<string>
89+
new()
9490
{
95-
"80:80"
91+
Identifier = "Getting.Started",
92+
ImageName = "docker/getting-started",
93+
ImageTags = new List<string> { "latest" },
94+
Ports = new List<string> { "80:80" },
95+
Environment = new List<string> { "80:80" },
9696
},
97-
Environment = new List<string>
98-
{
99-
"80:80"
100-
}
101-
}
102-
}
103-
};
97+
},
98+
};
10499

105100
private static void PersistConfig(Config config, string path)
106101
{
@@ -110,9 +105,9 @@ private static void PersistConfig(Config config, string path)
110105
var yaml = serializer.Serialize(config);
111106
File.WriteAllText(path, yaml);
112107
}
113-
108+
114109
public class ConfigVersion
115110
{
116111
public string Version { get; set; } = null!;
117112
}
118-
}
113+
}

src/Config/ConfigMigrations.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ public static Config Migrate10To11(Config10 config)
77
return new Config
88
{
99
DockerEndpoint = config.DockerEndpoint,
10-
ImageConfigs = config.Images.Select(e => new Config.ImageConfig
11-
{
12-
Identifier = e.Identifier,
13-
ImageName = e.ImageName,
14-
Ports = e.Ports,
15-
ImageTags = new List<string>
10+
ImageConfigs = config
11+
.Images.Select(e => new Config.ImageConfig
1612
{
17-
e.ImageTag
18-
}
19-
}).ToList()
13+
Identifier = e.Identifier,
14+
ImageName = e.ImageName,
15+
Ports = e.Ports,
16+
ImageTags = new List<string> { e.ImageTag },
17+
})
18+
.ToList(),
2019
};
2120
}
22-
}
21+
}

src/Config/ImageConfig.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
namespace port.Config;
2-

src/Config/Versions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ public static class Versions
44
{
55
public const string V10 = "1.0";
66
public const string V11 = "1.1";
7-
}
7+
}

0 commit comments

Comments
 (0)