Skip to content

Recommend EditorConfig to enforce code style between contributors. #733

@Akarinnnnn

Description

@Akarinnnnn

Our code style is different from a lot of .NET projects, such as ASP.NET Core. One big difference is we don't put start brace on new line, instead we put it at line end. This won't cause problem if only 1 person develop our project, but obviously there are many people are, or were participate in development process. Their development environment is configured to their shape, which includes code style that may be different to us. As for me, my code style is almost aligned with general .NET style. The style discrepancy between me and Steamworks.NET caused a restyle commit in #674.

Do we have some tool to manage code style, prevent restyle nowadays? Yes of course. EditorConfig is used to specify code style in a human readable text file. This file is called .editorconfig and can be stored in git repository directly. As we distribute that file along our code, any supported editor will read it then overlay on original style of contributor. In result, contributed code will have consistent style, as contributor remember to press format hotkey.

I would like project owner @rlabrecque to create and share .editorconfig files to contributors. In addition, I'd recommend to create .editorconfig for Python and C# code in separate. We manage C# style in /.editorconfig located in repository root, and manage Python style in /CodeGen/.editorconfig respectively.

If you want to contribute .editorconfig, here are some helpful links about mainstream editors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions