Skip to content

Commit 5b96f61

Browse files
authored
contributing (#31)
1 parent 9469a92 commit 5b96f61

File tree

3 files changed

+64
-4
lines changed

3 files changed

+64
-4
lines changed

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We do not tolerate life forms who refuse to share this openness and respect towa
88

99
We continuously strive to make our community a better place for everyone – in the best tradition of hackers we "build, test, improve, reiterate". In this ongoing adventure, we rely on the support, courage, and creativity of all members of the Node-DuckDB community.
1010

11-
If you are made uncomfortable in your role as Node-DuckDB community member, please let us know: You can reach us at ali@deepcrawl.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
11+
If you are made uncomfortable in your role as Node-DuckDB community member, please let us know: You can reach us at node-duckdb@deepcrawl.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
1212

1313
#### Attribution
1414

CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
## Code of Conduct
4+
5+
This project and everyone participating in it is governed by a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [node-duckdb@deepcrawl.com](mailto:node-duckdb@deepcrawl.com).
6+
7+
## **Did you find a bug?**
8+
9+
- **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/deepcrawl/node-duckdb/issues).
10+
- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/deepcrawl/node-duckdb/issues/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
11+
12+
## **Did you write a patch that fixes a bug?**
13+
14+
- Great!
15+
- If possible, add a unit test case to make sure the issue does not occur again.
16+
- Make sure you run the code linter (`yarn lint`).
17+
- Open a new GitHub pull request with the patch.
18+
- Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
19+
20+
## Branches
21+
22+
- Do not commit/push directly to the master branch. Instead, create a feature branch/fork and file a merge request.
23+
- When maintaining a branch, merge frequently with the master.
24+
- When maintaining a branch, submit merge requests to the master frequently.
25+
- If you are working on a bigger issue try to split it up into several smaller issues.
26+
27+
## Building and testing
28+
29+
- See the "Developing" section of the [README](README.md)
30+
31+
## Formatting and linting (TS)
32+
33+
- We use prettier and eslint, their respective configurations are in the default places
34+
- Files should use kebab-case, e.g. duckdb-config.ts
35+
36+
## Naming Conventions (C++)
37+
38+
- Files: snake-case, e.g., abstract_operator.cpp
39+
- Types (classes, structs, enums, typedefs, using): CamelCase starting with uppercase letter, e.g., BaseColumn
40+
- Variables: lowercase separated by underscores, e.g., chunk_size
41+
- Functions: CamelCase starting with uppercase letter, e.g., GetChunk
42+
- Choose descriptive names.
43+
- Avoid i, j, etc. in **nested** loops. Prefer to use e.g. **column_idx**, **check_idx**. In a **non-nested** loop it is permissible to use **i** as iterator index.
44+
45+
## C++ Guidelines
46+
47+
- Do not use `malloc`, prefer the use of smart pointers
48+
- Strongly prefer the use of `unique_ptr` over `shared_ptr`, only use `shared_ptr` if you **absolutely** have to
49+
- Do **not** import namespaces in headers (e.g. `using std`), only in source files
50+
- When overriding a virtual method, avoid repeating virtual and always use override or final
51+
- Use `[u]int(8|16|32|64)_t` instead of int, long, uint etc. In particular, use `index_t` instead of `size_t` for offsets/indices/counts of any kind.
52+
- Prefer using references over pointers
53+
- Use C++11 for loops when possible: for (const auto& item : items) {...}
54+
- Use braces for indenting `if` statements and loops. Avoid single-line if statements and loops, especially nested ones.
55+
- **Class Layout:** Start out with a `public` block containing the constructor and public variables, followed by a `public` block containing public methods of the class. After that follow any private functions and private variables.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@
1717

1818
First build:
1919

20-
1. `yarn install` - installs dependencies including duckdb
20+
1. `yarn install` - installs dependencies including downloading duckdb
2121
2. `yarn build:ts` - builds typescript
2222
3. `yarn test` - runs all tests
2323

2424
Other useful scripts:
2525

26-
- `yarn build:[addon|duckdb|ts]` - build native addon bindings, duckdb or the typescript code
27-
- `yarn lint`
26+
- `yarn build` - build everything
27+
- `yarn build:addon` - build just the bindings code
28+
- `yarn build:duckdb` - build just the duckdb database
29+
- `yarn build:ts` - build just the typescript code
30+
- `yarn lint` - lint the project
31+
- `yarn test` - run all tests
32+
- `yarn test csv` - run just the csv test suite
2833

2934
## Publishing
3035

0 commit comments

Comments
 (0)