api-linter icon indicating copy to clipboard operation
api-linter copied to clipboard

Check for common aliases in field and message names

Open jgeewax opened this issue 5 years ago • 0 comments

Some examples for fields:

  • string github_repo = 1 (not git_hub_repo)
  • string stackoverflow_username = 1 (not stack_overflow_username)
  • string bigquery_table = 1 (not big_query_table)

And fields in camel-case:

  • {"githubRepo": "foo"} (not gitHubRepo)
  • {"stackoverflowUsername": "foo"} (not stackOverflowUsername)
  • {"bigqueryTable": "foo"} (not bigQueryTable)

And similarly for upper camel case:

  • GithubRepoConfig (not GitHubRepoConfig)
  • StackoverflowProfile (not StackOverflowProfile)
  • BigqueryTableConfig (not BigQueryTableConfig)

The general idea is that even where a trademarked name has capital letters inside the name (or multiple pieces of a name where each is capitalized), we treat it as a single "unit" and then join it using whatever style is relevant (snake case, camel case, etc).

This can sometimes look strange when the cases are similar (e.g., BigQuery is the trademarked name, but we use BigqueryTableConfig) but if we were to capitalize each portion, that would hint that this is two distinct units rather than one (BigQueryTableConfig split into pieces is: [Big, Query, Table, Config])

jgeewax avatar Feb 19 '20 00:02 jgeewax