refactor: continued work to improve config handling and tests#1500
Merged
anderseknert merged 1 commit intomainfrom Apr 24, 2025
Merged
refactor: continued work to improve config handling and tests#1500anderseknert merged 1 commit intomainfrom
anderseknert merged 1 commit intomainfrom
Conversation
2bfbba8 to
f717635
Compare
- Check if files are ignored globally only once, and before proceeding
to check if they are ignored by some specific rule's configuration
- Stop using config.for_rule("category", "title") now that we can refer
directly to config.rules.category.title
- Stop using data.internal in tests
Obviously, there's gotta be some performance improvements in there
somewhere too :P Luckily having the global ignore check done only
once per file gave us that!
```
1070530708 ns/op 3041023912 B/op 58063258 allocs/op
1048394166 ns/op 2953960968 B/op 56616841 allocs/op
```
Now getting awfully close to sub-second times :)
Signed-off-by: Anders Eknert <anders@styra.com>
f717635 to
ef5fdc9
Compare
HookFirebolt
pushed a commit
to HookFirebolt/regal
that referenced
this pull request
Apr 28, 2025
…olicy-agent#1500) - Check if files are ignored globally only once, and before proceeding to check if they are ignored by some specific rule's configuration - Stop using config.for_rule("category", "title") now that we can refer directly to config.rules.category.title - Stop using data.internal in tests Obviously, there's gotta be some performance improvements in there somewhere too :P Luckily having the global ignore check done only once per file gave us that! ``` 1070530708 ns/op 3041023912 B/op 58063258 allocs/op 1048394166 ns/op 2953960968 B/op 56616841 allocs/op ``` Now getting awfully close to sub-second times :) Signed-off-by: Anders Eknert <anders@styra.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Obviously, there's gotta be some performance improvements in there somewhere too :P Luckily having the global ignore check done only once per file gave us that!
Now getting awfully close to sub-second times :)