You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatter always prefers to format interval literals with a space between value and unit, e.g., 1 min instead of 1min. It then considers the whitespace a potential line break, even though this produces invalid source code, e.g.,
$ cat bla.zeekevent zeek_init() { local aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1min; vector(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 5 min); }
$ zeek-format bla.zeekevent zeek_init() { local aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1 min; vector(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 5 min); }
$ zeek bla_formatted.zeekerror in ./bla_formatted.zeek, line 4: syntax error, at or near "min"
The text was updated successfully, but these errors were encountered:
I think @stevesmoot also encountered this, and I believe @Mohan-Dhawan did too (a good while ago). I fully agree that we should of course never format this way.
I took a quick look at Zeek's scanner and it treats this similarly to subnet ranges, which actually surprised me — it's happy to parse "192.168.0.0 /24", for example.
I took a quick look at Zeek's scanner and it treats this similarly to subnet ranges, which actually surprised me — it's happy to parse "192.168.0.0 /24", for example.
We currently have #29 open for exactly that, but I believe the issue is different there; I left a comment over there.
The formatter always prefers to format interval literals with a space between value and unit, e.g.,
1 min
instead of1min
. It then considers the whitespace a potential line break, even though this produces invalid source code, e.g.,The text was updated successfully, but these errors were encountered: