Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : Update the list of reserved words in AIP 140 #1352

Open
parthea opened this issue Mar 7, 2024 · 0 comments
Open

Feature Request : Update the list of reserved words in AIP 140 #1352

parthea opened this issue Mar 7, 2024 · 0 comments

Comments

@parthea
Copy link
Contributor

parthea commented Mar 7, 2024

From https://google.aip.dev/140#reserved-words,

Field names should avoid using names that are likely to conflict with keywords in common programming languages, such as new, class, function, import, etc. Reserved keywords can cause hardship for developers using the API in that language.

The reserved words list exists here

var reservedWordsSet = stringset.New(
"abstract", // Java, JavaScript
"and", // Python
"arguments", // JavaScript
"as", // Python
"assert", // Java, Python
"async", // Python
"await", // JavaScript, Python
"boolean", // Java, JavaScript
"break", // Java, JavaScript, Python
"byte", // Java, JavaScript
"case", // Java, JavaScript
"catch", // Java, JavaScript
"char", // Java, JavaScript
"class", // Java, JavaScript, Python
"const", // Java, JavaScript
"continue", // Java, JavaScript, Python
"debugger", // JavaScript
"def", // Python
"default", // Java, JavaScript
"del", // Python
"delete", // JavaScript
"do", // Java, JavaScript
"double", // Java, JavaScript
"elif", // Python
"else", // Java, JavaScript, Python
"enum", // Java, JavaScript
"eval", // JavaScript
"except", // Python
"export", // JavaScript
"extends", // Java, JavaScript
"false", // JavaScript
"final", // Java, JavaScript
"finally", // Java, JavaScript, Python
"float", // Java, JavaScript
"for", // Java, JavaScript, Python
"from", // Python
"function", // JavaScript
"global", // Python
"goto", // Java, JavaScript
"if", // Java, JavaScript, Python
"implements", // Java, JavaScript
"import", // Java, JavaScript, Python
"in", // JavaScript, JavaScript, Python
"instanceof", // Java, JavaScript
"int", // Java, JavaScript
"interface", // Java, JavaScript
"is", // Python
"lambda", // Python
"let", // JavaScript
"long", // Java, JavaScript
"native", // Java, JavaScript
"new", // Java, JavaScript
"nonlocal", // Python
"not", // Python
"null", // JavaScript
"or", // Python
"package", // Java, JavaScript
"pass", // Python
"private", // Java, JavaScript
"protected", // Java, JavaScript
"public", // Java, JavaScript
"raise", // Python
"return", // Java, JavaScript, Python
"short", // Java, JavaScript
"static", // Java, JavaScript
"strictfp", // Java
"super", // Java, JavaScript
"switch", // Java, JavaScript
"synchronized", // Java, JavaScript
"this", // Java, JavaScript
"throw", // Java, JavaScript
"throws", // Java, JavaScript
"transient", // Java, JavaScript
"true", // JavaScript
"try", // Java, JavaScript, Python
"typeof", // JavaScript
"var", // JavaScript
"void", // Java, JavaScript
"volatile", // Java, JavaScript
"while", // Java, JavaScript, Python
"with", // JavaScript, Python
"yield", // JavaScript, Python

However some reserved words, for example type, are missing from the list.

@parthea parthea changed the title Feature Request : Add linter for AIP 140 - Reserved terms Feature Request : Update the list of reserved words in AIP 140 Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant