docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Formatting

    Methods for invoking and validating code formatting

    Inheritance
    object
    Formatting
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Coding.Editor.Formatting
    Assembly: Unity.Coding.Editor.dll
    Syntax
    public static class Formatting

    Methods

    Format()

    Format files in your project based on .editorconfig rules.

    Note: Only files under "Assets/" and "Packages/" will be considered for formating. Please see full documentation for detail on formatters and EditorConfig.

    Declaration
    public static ICollection<string> Format()
    Returns
    Type Description
    ICollection<string>

    Collection of files that were formatted

    Format(string)

    Recursively format files in a specific project folder based on .editorconfig rules.

    Note: Only files under "Assets/" and "Packages/" will be considered for formating. Please see full documentation for detail on formatters and EditorConfig.

    Declaration
    public static ICollection<string> Format(string path)
    Parameters
    Type Name Description
    string path

    Path to file or folder to format.

    Returns
    Type Description
    ICollection<string>

    Collection of files that were formatted

    ValidateAllFilesFormatted(string, List<string>)

    Recursively validates if files in a specific project folder are correctly formatted based on .editorconfig rules.

    Note: Only files under "Assets/" and "Packages/" will be considered for formating. Please see full documentation for detail on formatters and EditorConfig.

    Declaration
    public static bool ValidateAllFilesFormatted(string path, List<string> failedFileList = null)
    Parameters
    Type Name Description
    string path

    Path to the file or directory that should be validated

    List<string> failedFileList

    List of files that have failed validation.

    Returns
    Type Description
    bool

    True if no files have failed validation, false otherwise

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)