You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{/* ktrain just wants to write all this so he doesn't forget */}
7
9
8
10
To begin contributing, you should read up on the specific area you want to contribute to.
@@ -24,4 +26,71 @@ To begin contributing, you should read up on the specific area you want to contr
24
26
- Put everything you're working on inside `project-files/`. This is a folder that is gitignored & vscodeignored by default, allowing you to store work-in-progress files without leaving them untracked.
25
27
- Try to open an issue for feature additions/non-patch changes. This will allow us to track progress via milestone, and also allow discussion while being able to link to other issues/PRs.
26
28
- Discussing on the thread in the Neuro Discord is also okay, it can also be used to post progress updates that don't need to be posted on GitHub (also gives updates to people who are following the thread but not the repo).
27
-
- Anything new, changed or removed should be documented on the docs folder.
29
+
- Any new, changed or removed feature should be documented on the [docs repo](https://github.com/VSC-NeuroPilot/docs).
30
+
31
+
## Conventions
32
+
33
+
Across NeuroPilot's code, we try to keep a certain convention to ensure productivity and familiarity.
34
+
Below is a compilation of our conventions that we use in the code.
35
+
36
+
<Aside>
37
+
38
+
Some conventions may have been violated in early code, before these conventions were "standardised".
39
+
We're working to refactor these eventually, but going forward everything must follow the conventions below.
40
+
41
+
</Aside>
42
+
43
+
### Naming conventions
44
+
45
+
- Types and type interfaces are capitalised via PascalCase. Functions are capitalised via camelCase. Constants that are initialised at the top of a file are in MACRO_CASE.
46
+
- Handler functions follow the `handle<ActionName>` convention, where `<ActionName>` is the name of the action converted to PascalCase (`handle` already takes the first word, so no camelCase for the `<ActionName>` part).
47
+
- The object with all the action data that governs how actions are sent, handled and validated follow the `<type>Actions` convention, where `<type>` is the name of the action category converted to camelCase.
48
+
- Registration functions that register actions follow the `register<Type>Actions` conventions, where `<Type>` is the name of the action category converted to PascalCase (for the same reasons as handler functions)
49
+
- Validator functions often, but aren't *strictly* required to, follow the `validate<Purpose>` or `<Purpose>Validation` conventions, where `<Purpose>` is what the function is validating, converted to PascalCase/camelCase respectively.
50
+
- Imports from `@types/vscode` often use the `import * as vscode from 'vscode'` import pattern.
51
+
52
+
### Placement conventions
53
+
54
+
These placement conventions apply to files which contain actions (such as `file_actions.ts` or `editing.ts`).
0 commit comments