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
buffrs init --lib my-protos
cd my-protos
printf'syntax = "proto3";\npackage wrongpkg;\nmessage Foo { string bar = 1; }\n'> proto/my_protos.proto
buffrs lint;echo"exit=$?"
PackageName (https://helsing-ai.github.io/buffrs/reference/protocol-buffer-rules.html)
× Make sure that the protobuf package name matches the buffer package name.
╰─▶ × package name is wrongpkg but should have my_protos prefix
╭─[my-protos/my_protos.proto:1:1]
╰────
exit=0
Note the violation goes to stderr, not stdout, so the obvious buffrs lint | grep ... workaround silently passes.
Expected
Non-zero exit when one or more violations are reported.
Actual
exit=0 regardless of violation count.
Impact
CI must do buffrs lint 2>&1 | grep -q '×' && exit 1, which is fragile and breaks on any output format change. Consumers are effectively unable to enforce lint.
Suggested fix
Return a non-zero exit status when the violation count is greater than zero. Since rules carry a severity Level already, gate on Level::Error by default and add --deny warnings / --allow warnings to make the threshold configurable.
Side note
While writing this I noticed IdentCasing is registered in the rule set but its check_entity returns Default::default() — identifier casing is never actually checked. That is a separate bug; happy to file it separately if useful.
Activity