Skip to content

chickensoft-games/EditorConfig

Repository files navigation

Chickensoft EditorConfig

Chickensoft Badge Discord

Chickensoft's EditorConfig for C#. If you want to write code in the style of the other Chickensoft packages, this EditorConfig is for you!

Installation

This is provided as a .NET template. To install it, run the following command:

dotnet new --install Chickensoft.EditorConfig

And to generate an editor config:

# Creates a .editorconfig in the current directory.
dotnet new chickenconfig

About

  • ✅ Indentation is 2 spaces (not tabs).
  • ✅ Newlines are LF only.
  • ✅ Many dotnet analyzers are configured to be enabled as warnings by default.
  • ✅ Warnings for methods that can be made static and names that match reserved keywords are disabled by default to accommodate Chickensoft packages (GoDotTest and LogicBlocks, respectively).

This coding style makes no attempt to follow Microsoft's standards. Rather, it is designed for ease of use while writing C# scripts and packages for use with the Godot Engine.

Notable style choices:

  • ✅ Allman Style Braces (a recent change in Chickensoft style from K&R braces)

    namespace MyNamespace;
    
    public class MyObject
    {
      // Opening braces don't have their own line.
    }
  • ✅ Non-private constant fields are UPPER_CASE

    public class MyObject
    {
      public const int A_NUMBER = 42;
      protected const string SOME_TEXT = "Hello, world!";
    }
  • ✅ Private constant fields are _camelCase

    public class MyObject
    {
      private const int _someNumber = 42;
      private const string _someText = "Hello, world!";
    }
  • ✅ Properties, Methods, Events, etc., are always PascalCase

    public class MyObject
    {
      public int MyProperty { get; set; }
      private string MyOtherProperty => "Hello, world!";
    
      private event EventHandler MyEvent;
    
      public void MyMethod() { }
    
      private void MyOtherMethod() { }
    }

About

Chickensoft's EditorConfig for C#.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors