Various small fixes#1736
Conversation
anderseknert
commented
Oct 29, 2025
- Add debugging configuration to enable inlineValues in project
- Don't use hardcoded "/" in eval test paths (as that won't work on Windows)
- More efficient input creation in aggregate lint step
- Add debugging configuration to enable inlineValues in project - Don't use hardcoded "/" in eval test paths (as that won't work on Windows) - More efficient input creation in aggregate lint step Signed-off-by: Anders Eknert <anders@eknert.com>
4c48230 to
ef339d5
Compare
| } | ||
| }, | ||
| // Enable to have values displayed inline during debugging | ||
| // The default value is "auto", which consults the language extension on whethher |
There was a problem hiding this comment.
| // The default value is "auto", which consults the language extension on whethher | |
| // The default value is "auto", which consults the language extension on whether |
| } | ||
|
|
||
| createWithContent(t, tmpDir+"/workspace/foo/bar/input."+tc.fileExt, tc.fileContent) | ||
| inputPath := filepath.Join(workspacePath, "foo", "bar", "input."+tc.fileExt) |
There was a problem hiding this comment.
filepath.Join is quite clever, I think you should be able to do this, too:
| inputPath := filepath.Join(workspacePath, "foo", "bar", "input."+tc.fileExt) | |
| inputPath := filepath.Join(workspacePath, "foo/bar/input."+tc.fileExt) |
Join also calls Clean, so it'll adjust your / and \ as needed, IIRC.
| regal := ast.ObjectTerm( | ||
| ast.Item(ast.InternedTerm("operations"), ast.ArrayTerm(ast.InternedTerm("aggregate"))), | ||
| ast.Item(ast.InternedTerm("file"), ast.ObjectTerm( | ||
| ast.Item(ast.InternedTerm("name"), ast.InternedTerm("__aggregate_report__")), | ||
| ast.Item(ast.InternedTerm("lines"), ast.InternedEmptyArray), | ||
| )), | ||
| ) |
There was a problem hiding this comment.
🤔 I wonder if the compiler will raise this out of the function body, since it's constant... alternatively, you could do that, if this is called more than once, perhaps in the LSP scenario.
There was a problem hiding this comment.
Yes, definitely for the LSP scenario! Will update 👍
| policies := make(map[string]string, 2) | ||
| policies["foo.rego"] = `package foo | ||
| import data.bar | ||
|
|
||
| default allow := false | ||
| ` | ||
| policies["bar.rego"] = `package bar | ||
| import data.foo.allow | ||
| ` |
There was a problem hiding this comment.
| policies := map[string]string{ | |
| "foo.rego": `package foo | |
| import data.bar | |
| default allow := false | |
| `, | |
| "bar.rego": `package bar | |
| import data.foo.allow | |
| `, | |
| } |
|
@srenatus I'll come back to address your (all valid!) points later. Highest priority now is to just get as many of the windows tests to work before we prepare the next release, so I merged this so @charlieegan3 (who's also working on this) and I have a shared state. |