node-rdkafka
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to node-rdkafka
which is hosted in the Blizzard Organization
on GitHub. This document lists rules, guidelines, and help getting started,
so if you feel something is missing feel free to send a pull request.
What should I know before I get started?
Not currently required.
Please use Github Issues to report bugs. When filling out an issue report, make sure to copy any related code and stack traces so we can properly debug. We need to be able to reproduce a failing test to be able to fix your issue most of the time, so a custom written failing test is very helpful.
Please also note the Kafka broker version that you are using and how many
replicas, partitions, and brokers you are connecting to, because some issues
might be related to Kafka. A list of librdkafka
configuration key-value pairs
also helps.
Please use Github Issues to suggest enhancements. We are happy to consider any extra functionality or features to the library, as long as they add real and related value to users. Describing your use case and why such an addition helps the user base can help guide the decision to implement it into the library's core.
linter
does not report any issues.Nan
whenever possible to abstract node/v8 version incompatibility.Download the EditorConfig plugin for your preferred text editor to automate the application of the following guidelines:
Also, adhere to the following not enforced by EditorConfig:
lf
line endings. (git's core.autocrlf
setting can help)Commit messages should adhere to the guidelines in tpope's A Note About Git Commit Messages
In short:
module.exports
at or near the top of the file.
let
, const
,
or class
).make jslint
).m_
.cpplint.py
in the make lint
test.mocha
testing framework.mocha
tests should use exports syntax.mocha
test files should be suffixed with .spec.js
instead of .js
.lib/client.js
is tested in test/client.spec.js
).@see
to reference similar pieces of code.I began using Visual Studio code to develop on node-rdkafka
. If you use it you can configure the C++ plugin to resolve the paths needed to inform your intellisense. This is the config file I am using on a mac to resolve the required paths:
c_cpp_properties.json
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}",
"${workspaceFolder}/src",
"${workspaceFolder}/node_modules/nan",
"${workspaceFolder}/deps/librdkafka/src",
"${workspaceFolder}/deps/librdkafka/src-cpp",
"/usr/local/include/node",
"/usr/local/include/node/uv"
],
"defines": [],
"macFrameworkPath": [
"/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
Use gdb
for debugging (as shown in the following example).
node-gyp rebuild --debug
gdb node
(gdb) set args "path/to/file.js"
(gdb) run
[output here]
You can add breakpoints and so on after that.