Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #1367

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bundle/regal/config/exclusion.rego
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ excluded_file(category, title, file) if {
_exclude(pattern, file)
}

_global_ignore_patterns := data.eval.params.ignore_files

_global_ignore_patterns := merged_config.ignore.files if not data.eval.params.ignore_files
_global_ignore_patterns := data.eval.params.ignore_files if {
count(data.eval.params.ignore_files) > 0
} else := merged_config.ignore.files

# exclude imitates .gitignore pattern matching as best it can
# ref: https://git-scm.com/docs/gitignore#_pattern_format
Expand Down
1 change: 0 additions & 1 deletion internal/lsp/completions/providers/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ func prepareQuery(ctx context.Context, store storage.Store, query string) (*rego

func prepareRegoArgs(store storage.Store, query ast.Body) []func(*rego.Rego) {
return []func(*rego.Rego){
rego.StoreReadAST(true),
rego.Store(store),
rego.ParsedQuery(query),
rego.ParsedBundle("regal", &rbundle.LoadedBundle),
Expand Down
2 changes: 1 addition & 1 deletion internal/lsp/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewRegalStore() storage.Store {
// we'll need to conform to the most basic "JSON" format understood by the store
"defined_refs": map[string]any{},
},
}, inmem.OptRoundTripOnWrite(false))
}, inmem.OptRoundTripOnWrite(false), inmem.OptReturnASTValuesOnRead(true))
}

func transact(ctx context.Context, store storage.Store, writeMode bool, op func(txn storage.Transaction) error) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ func fromOPABuiltin(builtin ast.Builtin) *Builtin {
func fromOPACapabilities(capabilities *ast.Capabilities) *Capabilities {
var result Capabilities

result.Builtins = make(map[string]*Builtin)
result.Builtins = make(map[string]*Builtin, len(capabilities.Builtins))

for _, builtin := range capabilities.Builtins {
result.Builtins[builtin.Name] = fromOPABuiltin(*builtin)
Expand Down
Loading