Skip to content

Commit

Permalink
Merge pull request #73 from guitarrapc/feature/errorfilter
Browse files Browse the repository at this point in the history
feat: use Compiled regex on errorFilter
  • Loading branch information
guitarrapc authored Jun 27, 2023
2 parents f5d582c + 1dcd1c1 commit 17abb9b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
56 changes: 28 additions & 28 deletions sandbox/Sandbox.Unity/UserSettings/Layouts/default-2021.dwlt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: 1043
y: 355
x: 8
y: 51
width: 2544
height: 1341
m_ShowMode: 4
Expand Down Expand Up @@ -48,7 +48,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 17
controlID: 95
--- !u!114 &3
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down Expand Up @@ -94,8 +94,8 @@ MonoBehaviour:
y: 0
width: 502
height: 781
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
Expand Down Expand Up @@ -223,7 +223,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 49
controlID: 16
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -248,7 +248,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 50
controlID: 17
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -268,8 +268,8 @@ MonoBehaviour:
y: 0
width: 1526
height: 781
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 16}
m_Panes:
- {fileID: 16}
Expand Down Expand Up @@ -325,8 +325,8 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1043
y: 1166
x: 8
y: 862
width: 2027
height: 489
m_ViewDataDictionary: {fileID: 0}
Expand All @@ -346,22 +346,22 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Editor
- Assets
m_Globs: []
m_OriginalText:
m_ViewMode: 1
m_StartGridSize: 64
m_LastFolders:
- Assets/Editor
- Assets
m_LastFoldersGridSize: -1
m_LastProjectPath: D:\git\guitarrapc\UnityBuildRunner\sandbox\Sandbox.Unity
m_LastProjectPath: C:\git\guitarrapc\UnityBuildRunner\sandbox\Sandbox.Unity
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 30590000
m_LastClickedID: 22832
m_ExpandedIDs: 000000002e59000000ca9a3bffffff7f
m_SelectedIDs: 765d0000
m_LastClickedID: 23926
m_ExpandedIDs: 00000000765d000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand Down Expand Up @@ -389,7 +389,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs:
m_ExpandedIDs: 00000000765d0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand All @@ -416,7 +416,7 @@ MonoBehaviour:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c6230000
m_RenameOverlay:
m_UserAcceptedRename: 0
Expand Down Expand Up @@ -465,8 +465,8 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 3071
y: 385
x: 2036
y: 81
width: 515
height: 1270
m_ViewDataDictionary: {fileID: 0}
Expand Down Expand Up @@ -506,8 +506,8 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1043
y: 385
x: 8
y: 81
width: 501
height: 760
m_ViewDataDictionary: {fileID: 0}
Expand All @@ -517,9 +517,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 38fbffff
m_SelectedIDs: 145d0000
m_LastClickedID: 23828
m_ExpandedIDs: 2afbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand Down Expand Up @@ -563,8 +563,8 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1545
y: 385
x: 510
y: 81
width: 1524
height: 760
m_ViewDataDictionary: {fileID: 0}
Expand Down
5 changes: 3 additions & 2 deletions src/UnityBuildRunner.Core/ErrorFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ public record ErrorFilterResult(string Message, string MatchPattern);
public class DefaultErrorFilter : IErrorFilter
{
private readonly IReadOnlyList<Regex> regexes;

public DefaultErrorFilter()
{
var options = RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Multiline; ;
var options = RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Multiline | RegexOptions.Compiled;
var errorFilters = new[]
{
"Compilation failed",
Expand All @@ -42,7 +43,7 @@ public void Filter(string message, Action<ErrorFilterResult> onMatch)
{
if (regex.IsMatch(message))
{
onMatch?.Invoke(new ErrorFilterResult(message, regex.ToString()));
onMatch.Invoke(new ErrorFilterResult(message, regex.ToString()));
}
}
}
Expand Down

0 comments on commit 17abb9b

Please sign in to comment.