api-linter
api-linter copied to clipboard
Check for common aliases in field and message names
Some examples for fields:
-
string github_repo = 1
(notgit_hub_repo
) -
string stackoverflow_username = 1
(notstack_overflow_username
) -
string bigquery_table = 1
(notbig_query_table
)
And fields in camel-case:
-
{"githubRepo": "foo"}
(notgitHubRepo
) -
{"stackoverflowUsername": "foo"}
(notstackOverflowUsername
) -
{"bigqueryTable": "foo"}
(notbigQueryTable
)
And similarly for upper camel case:
-
GithubRepoConfig
(notGitHubRepoConfig
) -
StackoverflowProfile
(notStackOverflowProfile
) -
BigqueryTableConfig
(notBigQueryTableConfig
)
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])