Thank you for taking time to contribute. We are delighted to receive contributions from the community. For wink-nlp
every contribution matters — whether you are reporting a bug, posting a question or suggestion, submitting a pull request or updating the documentation.
This document will guide you through the contribution process and guidelines.
If you spot a bug/issue and the same has not yet been reported, raise a new issue or consider fixing it and sending a PR. If you have questions and/or suggestions, post them at our discussions. New features may also be discussed there; eventually you may consider developing the same and sending a PR.
- Fork the repository from github
- Develop your code changes
- Capture the logic in comments
- Ensure that the API is properly documented
- Ensure proper linting
- Write test cases to cover each and every change and/or new feature
- Review security and performance
- Run the entire test suite
- Make sure coverage either stays at the current levels or improves; note minimum acceptable level is ≥99.5%
- Commit your changes in compliance with commit guidelines
- Push to your fork
- Sign the CLA if you are contributing for the first time
After completing the above steps, you are ready to submit the pull request.
By contributing, you are expected to uphold wink’s code of conduct. In essence, each one of us should:
- respect fellow contributors, irrespective of their level of experience, race, religion, gender, sexual orientation, and age;
- collaborate constructively;
- never engage in any form of offense, harassment, insult, personal attack, provocation and/or use of inappropriate language;
WinkNLP is a developer-friendly Natural Language Processing (NLP) library, whose API is designed specifically to make development of NLP solutions easier and faster. Do take out some time in understanding the structure of APIs, before attempting any enhancements.
In winkNLP, we prefer functions and closures over objects/classes.
Like artisans, we too need a toolset and process to create beautiful software. The process is orchestrated by Travis CI in accordance with the configuration files present in the repository. The details are outlined below:
Well defined linting rules or coding standards help us in making code more consistent and avoid bugs. ESLint enforces these rules automatically. These rules are defined in a configuration file named .eslintrc.json
, which is located at the root of the repository. These rules cover basic formatting, naming conventions, limits of code complexity, and many more; please refer to the configuration file for further details.
We recommend using a suitable ESLint plugin/add-on for the code editor. Use script npm run pretest
at command line to run linting on the entire code.
We believe that the documentation must not only explain the API but also narrate the story of logic, algorithms and references used. WinkNLP uses the JSDoc standard for API documentation. It is inspired by Literate-Programming Standards for documenting the logic using docker; the npm run sourcedocs
script generates a well formatted code documentation in HTML.
Test cases should cover each and every feature and/or change; use of standard test heuristics such as equivalence partition, boundary values, empty/null value, and decision tree is recommended to write effective test cases.
WinkNLP requires a test coverage of at least ≥99.5% and aims for 100%. Any new contribution must maintain the existing test coverage level. We use Chai, Mocha and Istanbul, Coveralls to run tests and determine coverage.
Use script npm run test
at command line to run the entire test suite and obtain test coverage report.
It is important to maintain the performance of winkNLP, whenever a change is made and/or a new feature is added. We use the benchmark package to measure performance in tokens per second for the entire NLP pipeline. Use script npm run perf
at command line to measure performance.
Our security review/testing is inspired from the recommendations in OWASP's NodeJS Security Cheat Sheet that are applicable to winkNLP — since it is a library used by developers to create NLP web/mobile/CLI apps/tools, only Platform Security specific recommendations apply. We follow the guidelines outlined below:
- Stay away from using any external package — winkNLP has 0 external dependency.
- Use ESLint as a Static Analysis Security Testing (SAST) tool.
- Never use
eval()
function. - Avoid prototype pollution by using objects created via
Object.create( null )
. - Perform input validation with defined default behavior.
- Use tools like regexploit to detect potential ReDoS apart from reviewing regexes using regex 101 on Chrome browser (Latest stable version), Node.js (LTS version).
We follow commit guidelines from Google's Angular Project, whose documentation is licensed under CC BY 4.0. See important excerpts for quick reference below:
Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
The header is mandatory and the scope of the header is optional. Any line of the commit message should not be longer than 100 characters!
Type should be one of the following:
build
: Changes that affect the build system or external dependenciesci
: Changes to our CI configuration files and scriptsdocs
: Documentation only changesfeat
: A new featurefix
: A bug fixperf
: A code change that improves performancerefactor
: A code change that neither fixes a bug nor adds a featuretest
: Adding missing tests or correcting existing testsrevert:
When you have to revert to an older commit. Ths subject should be the header of the old commit and the body should containThis reverts commit <hash>.
Use thegit revert
command to accomplish this.
Scope specifies the place of the commit change. You can use *
when the change affects more than a single scope.
Subject must contain a crisp description of the change and it must (a) use the imperative, present tense: "change" not "changed" nor "changes", (b) not capitalize the first letter, and (c) not use period (.) at the end.
Body just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change.
Footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit closes. Breaking Changes should start with the word BREAKING CHANGE:
with a space or two newlines. The rest of the commit message is then used for this.
WinkNLP follows semantic versioning for every release.
This section outlines winkNLP’s governance guidelines:
- This is a project of Graype Systems Private Limited (Graype), which is a micro-size company incorporated in India.
- The project team consists of 3-core members, including a technical lead.
- The project welcomes contributions from the community. For winkNLP every contribution matters — whether it is reporting a bug/issue, posting a question/suggestion, submitting a pull request or updating the documentation.
- Everyone is entitled to state their opinion and may present their arguments. There is an effort to achieve consensus but in absence of obvious consensus, the technical lead has the final say in decision making. It roughly matches a standard BDFL (Benevolent Dictator For Life) style project.
- WinkNLP is licensed under the terms of the MIT license; therefore there are no limitations on forking and developing it further separately.
- The technical lead has commit and administrative rights on the project's organization and repository at Github. Therefore the technical lead can make changes and accept changes — typically pull requests submitted by others. These changes may include changes to the process and contribution requirements.
- Graype offers commercial support and/or services around the project.
- The key roles are (a) User — who uses or has used the package; (b) Contributor — who has reported one or more issues, participated in one or more discussions OR sent one or more PRs; (c) Core Team Member as stated above and (d) Technical Lead.
- Core team members are Prateek Saxena, Rachna Chakraborty and Sanjaya Kumar Saxena (Technical Lead).
- Current opportunities to participate are outlined in the roadmap.
- Every PR must comply with our development guidelines before they can be accepted/merged.
- Participation requires adherence to our code of conduct.
The CLA is for your protection as well as the protection of Graype and it’s licensees; it does not change your rights to use your own Contributions for any other purpose. Our CLA is a short and easy to understand agreement and can be signed using a simple click-through form. Please sign our Contributor License Agreement (CLA) before sending pull requests. It's a quick process, we promise!