mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 10:32:35 -05:00
Update Replace Regex for Code Formatting in 'Invoke-Preprocessing' Script Tool
This commit is contained in:
@ -118,11 +118,11 @@
|
|||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# make more formatting rules, and document them in WinUtil Official Documentation
|
# make more formatting rules, and document them in WinUtil Official Documentation
|
||||||
(Get-Content -Raw "$file").TrimEnd() `
|
(Get-Content "$file").TrimEnd() `
|
||||||
-replace ('\t', ' ') `
|
-replace ('\t', ' ') `
|
||||||
-replace ('\)\s*\{', ') {') `
|
-replace ('\)\s*\{', ') {') `
|
||||||
-replace ('(?<keyword>if|for|foreach)\s*(?<condition>\([\s\S]\))\s*\{', '${keyword} ${condition} {') `
|
-replace ('(?<keyword>if|for|foreach)\s*(?<condition>\([.*?]\))\s*\{', '${keyword} ${condition} {') `
|
||||||
-replace ('\}\s*elseif\s*(?<condition>\([\s\S]\))\s*\{', '} elseif ${condition} {') `
|
-replace ('\}\s*elseif\s*(?<condition>\([.*?]\))\s*\{', '} elseif ${condition} {') `
|
||||||
-replace ('\}\s*else\s*\{', '} else {') `
|
-replace ('\}\s*else\s*\{', '} else {') `
|
||||||
-replace ('Try\s*\{', 'try {') `
|
-replace ('Try\s*\{', 'try {') `
|
||||||
-replace ('Catch\s*\{', 'catch {') `
|
-replace ('Catch\s*\{', 'catch {') `
|
||||||
|
Reference in New Issue
Block a user