From 281b6f01a2320dd4c39610d39b3240ffadaadef1 Mon Sep 17 00:00:00 2001 From: ProfessionalUwU Date: Sat, 3 Jun 2023 08:51:24 +0200 Subject: [PATCH] Add formating rules --- .editorconfig | 26 ++++++++++++++++++++++++++ Program.cs | 28 ++++++++++++++-------------- pacserver.cs | 28 ++++++++++++++-------------- 3 files changed, 54 insertions(+), 28 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a56e1dc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# C# files +[*.cs] + +# Indentation and spacing +indent_size = 4 +indent_style = tab +tab_width = 4 + +# Naming Conventions +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# New line preferences +csharp_new_line_before_open_brace = none +csharp_new_line_before_else = false +csharp_new_line_before_catch = false +csharp_new_line_before_finally = false + +# Wrapping preferences +csharp_preserve_single_line_statements = true +csharp_preserve_single_line_blocks = true + +# Switch case +csharp_indent_case_contents = true \ No newline at end of file diff --git a/Program.cs b/Program.cs index cb430b9..d2ab9e7 100644 --- a/Program.cs +++ b/Program.cs @@ -1,16 +1,16 @@ public class Program { - static void Main(string[] args) { - if (args.Length == 0) { - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine("Please specify an option."); - Console.ResetColor(); - } else { - switch(args[0]) { - case "": - break; - default: - break; - } - } - } + static void Main(string[] args) { + if (args.Length == 0) { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("Please specify an option."); + Console.ResetColor(); + } else { + switch (args[0]) { + case "": + break; + default: + break; + } + } + } } \ No newline at end of file diff --git a/pacserver.cs b/pacserver.cs index da563c9..b7f3b79 100644 --- a/pacserver.cs +++ b/pacserver.cs @@ -1,23 +1,23 @@ public class Pacserver { - public static string pacmanCacheDirectory { get; set; } = string.Empty; - public static string determinePacmanCacheDirectory() { - return pacmanCacheDirectory; - } + public static string pacmanCacheDirectory { get; set; } = string.Empty; + public static string determinePacmanCacheDirectory() { + return pacmanCacheDirectory; + } - public static string pacmanDatabaseDirectory { get; set; } = string.Empty; - public static string determinePacmanDatabaseDirectory() { - return pacmanDatabaseDirectory; - } + public static string pacmanDatabaseDirectory { get; set; } = string.Empty; + public static string determinePacmanDatabaseDirectory() { + return pacmanDatabaseDirectory; + } - public static void checkForNewerPackagesAndDatabases() { + public static void checkForNewerPackagesAndDatabases() { - } + } - public static void transferPacmanCache() { + public static void transferPacmanCache() { - } + } - public static void transferPacmanDatabases() { + public static void transferPacmanDatabases() { - } + } } \ No newline at end of file