Automatic JSON Formatting Workflow

This change alters the existing format workflow to include another job that handles formatting JSON files. The JSON files are formatted using BiomeJS. The BiomeJS config file is dynamically created before Biome runs and removed after. This uses the existing `.editorconfig` settings as defaults, allowing overwrites and additional Biome configurations within the workflow file.

Current JSON formatting rules:
- end_of_line = lf
- insert_final_newline = true
- indent_style = space
- trim_trailing_whitespace = true
- charset = utf-8
- indent_size = 2
- trailingCommas = none
- bracketSpacing = true
- expand = always

The existing Csharpier job runs at the same time as the new Biome job. The results (changes made) in each job are compressed into an artifact and downloaded into a final job that combines them and commits them back into the project (if there are changes, and if the workflow is not triggered within a PR).
This commit is contained in:
Refringe
2025-07-26 19:20:46 -04:00
parent b74adca201
commit c5198ccd22
3 changed files with 196 additions and 58 deletions
+5 -8
View File
@@ -1,23 +1,20 @@
# editorconfig.org
# top-most EditorConfig file
root = true
# Default settings:
# A newline ending every file
# Use 4 spaces as indentation
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[{*.yaml,*.yml}]
charset = utf-8
indent_size = 2
[*.json]
ij_formatter_enabled = true
charset = utf-8
indent_size = 2
ij_formatter_enabled = true
# C# files
[*.cs]
@@ -152,4 +149,4 @@ resharper_merge_into_pattern_highlighting = none
indent_size = 2
[*.{csproj,vbproj,proj,nativeproj,locproj}]
charset = utf-8
charset = utf-8