Class Formatting
Methods for invoking and validating code formatting
Inherited Members
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 |