Skip to content
Latchkey

buf lint "Field name ... should be lower_snake_case" violations in CI

buf lint applies a configured rule set (DEFAULT, or selected categories) to your protos and reports every violation with a file, line, and rule. Any violation fails the step, so a single mis-named field can block the pipeline.

What this error means

buf lint exits non-zero listing violations such as "Field name \"userId\" should be lower_snake_case" or "Enum value name ... should be prefixed with ...". Each line ends with the rule ID.

buf
user/v1/user.proto:8:10:Field name "userId" should be lower_snake_case, such as "user_id".
user/v1/user.proto:14:3:Enum value name "ACTIVE" should be prefixed with "STATUS_".

Common causes

Proto names break the configured style rules

The DEFAULT rule set requires lower_snake_case fields, prefixed enum values, and other conventions. Names that predate the rule trip it.

A rule is enabled that the codebase never followed

Adopting buf lint on an existing schema surfaces many violations at once because the code was not written to those rules.

How to fix it

Rename to satisfy the rule

  1. Read the rule ID at the end of each violation line.
  2. Rename the field, enum value, or service to the suggested form.
  3. Re-run buf lint until it reports no violations.
Terminal
buf lint

Adjust the rule set deliberately

If a rule does not fit your API, exclude it in buf.yaml rather than ignoring failures. Keep the rest enforced.

buf.yaml
# buf.yaml
version: v1
lint:
  use:
    - DEFAULT
  except:
    - ENUM_VALUE_PREFIX

How to prevent it

  • Run buf lint locally and in a pre-commit hook before pushing.
  • Adopt lint rules on a new package, then migrate older ones incrementally.
  • Configure the rule set in buf.yaml so local and CI results match.

Frequently asked questions

What causes "buf lint violations"?
The DEFAULT rule set requires lower_snake_case fields, prefixed enum values, and other conventions. Names that predate the rule trip it.
How do I fix buf lint violations?
Rename to satisfy the rule

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card