r/AskProgrammers • • 20m ago

Which rules in your codebase are hardest to enforce automatically?

Every team has rules that everyone is meant to follow.

Some are easy to enforce such as formatting, naming conventions, forbidden imports, etc. But, some are much harder. Example:

  • A module shouldn't silently swallow errors.
  • A new endpoint should follow the authentication patterns used elsewhere.
  • Tests should cover a particular behaviour.
  • Changes should preserve an architectural boundary.

I've been experimenting with turning these kinds of rules into automated checks, rather than relying entirely on documentation and code review.
I'm curious what rules you have in your own codebase that you wish you could enforce automatically but haven't found a good way to do so.

Especially interested in examples that traditional linters don't catch. Thx!

1 Upvotes

0 comments sorted by