Search code examples
c#github-actionslintsuper-linter

Github Super linter - How to customize the rules for C# linter?


I am trying to integrate GitHub super linter as an Action. Their documentation provided environment variables for other languages if we want to provide a custom rule file. For C#, that provision is not there. How can I add custom rules for super linter in that case?


Solution

  • The C# Super Linter relies on the dotnet format command. You can configure dotnet format using an .editorconfig file in your repository.

    For example:

    # C# files
    [*.cs]
    
    #### Core EditorConfig Options ####
    
    # Indentation and spacing
    indent_size = 4
    indent_style = space
    tab_width = 4
    
    #### .NET Coding Conventions ####
    
    # this. and Me. preferences
    dotnet_style_qualification_for_method = true