build(deps): bump github.com/open-policy-agent/opa from 1.18.1 to 1.18.2

Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 1.18.1 to 1.18.2.
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-policy-agent/opa/compare/v1.18.1...v1.18.2)

---
updated-dependencies:
- dependency-name: github.com/open-policy-agent/opa
  dependency-version: 1.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2026-07-02 14:44:13 +00:00
committed by Ralf Haferkamp
parent 2683b2db6f
commit bce52eec38
6 changed files with 4975 additions and 12 deletions

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1902,13 +1902,10 @@ func (w *writer) writeIterable(elements []any, last *ast.Location, close *ast.Lo
return nil, err
}
hasBoundaryComment := false
newlinePrecedesItem := false
// If there are comments within the single line, don't collapse it and keep it as-is
// Return an error so that writeTerm will write the original formatting
if len(lines) == 1 {
if w.beforeEnd != nil {
hasBoundaryComment = w.beforeEnd.Location.Row >= last.Row && w.beforeEnd.Location.Row <= close.Row
}
for _, c := range comments {
if c.Location.Row > last.Row && c.Location.Row < close.Row {
return comments, unexpectedCommentError{
@@ -1916,13 +1913,24 @@ func (w *writer) writeIterable(elements []any, last *ast.Location, close *ast.Lo
newCommentRow: c.Location.Row,
}
}
if c.Location.Row == last.Row || c.Location.Row == close.Row {
hasBoundaryComment = true
}
if len(elements) > 0 {
var first *ast.Term
if term, ok := elements[0].(*ast.Term); ok {
first = term
} else if pair, ok := elements[0].([2]*ast.Term); ok {
first = pair[0]
}
cut := bytes.Index(last.Text, first.Location.Text)
if cut > 0 {
txt := last.Text[:cut]
newlinePrecedesItem = bytes.IndexByte(txt, '\n') > 0
}
}
}
isMultiline := len(lines) > 1 || (len(lines) == 1 && len(elements) > 0 && close.Row > last.Row && !hasBoundaryComment)
isMultiline := len(lines) > 1 || (len(lines) == 1 && newlinePrecedesItem)
if isMultiline {
w.delayBeforeEnd()
w.startMultilineSeq()

View File

@@ -10,7 +10,7 @@ import (
"runtime/debug"
)
var Version = "1.18.1"
var Version = "1.18.2"
// GoVersion is the version of Go this was built with
var GoVersion = runtime.Version()