mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Update CodeQL Style guide to mention acronyms
Adding this after asking how to do this internally. Is based on https://dart.dev/guides/language/effective-dart/style#do-capitalize-acronyms-and-abbreviations-longer-than-two-letters-like-words
This commit is contained in:
committed by
GitHub
parent
a45c415c5b
commit
0ea7aa54f9
@@ -173,6 +173,7 @@ private predicate foo(Expr e, Expr p) {
|
||||
1. Use [camelCase](https://en.wikipedia.org/wiki/Camel_case) for:
|
||||
- Predicate names
|
||||
- Variable names
|
||||
1. Abbreviations and acronyms *should* use normal PascalCase/camelCase (if there are only two letters, it is generally ok to use all uppercase letters).
|
||||
1. Newtype predicate names *should* begin with `T`.
|
||||
1. Predicates that have a result *should* be named `get...`
|
||||
1. Predicates that can return multiple results *should* be named `getA...` or `getAn...`
|
||||
@@ -183,6 +184,7 @@ private predicate foo(Expr e, Expr p) {
|
||||
1. Use names as they are used in the target-language specification.
|
||||
1. Use American English.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```ql
|
||||
@@ -209,6 +211,9 @@ class Type extends ... {
|
||||
|
||||
/** ... */
|
||||
Type getATypeParameter() { ... }
|
||||
|
||||
/** ... */
|
||||
predicate getHttpConnection() { ... }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user