Skip to content

Commit

Permalink
chore: Switch to nlm
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Krems committed Jan 26, 2016
1 parent dfcf0aa commit bdac8c6
Show file tree
Hide file tree
Showing 23 changed files with 440 additions and 300 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
8 changes: 1 addition & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"extends": "airbnb/legacy",
"rules": {
"id-length": 0,
"vars-on-top": 0,
"strict": [2, "global"],
"no-param-reassign": 0
}
"extends": "groupon/legacy"
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
node_modules/
npm-debug.log
/tmp
*.log
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
language: node_js
node_js:
- "0.10"
- "4"
- '0.10'
- '4'
services: memcached
before_install:
- npm install -g npm@latest-2
before_deploy:
- git config --global user.email "[email protected]"
- git config --global user.name "Groupon"
deploy:
provider: script
script: './node_modules/.bin/nlm release'
skip_cleanup: true
on:
branch: master
node: '4'
160 changes: 138 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,146 @@
# Contribution Guide
<!-- Generated by generator-nlm -->

Please follow this guide when
creating issues or pull requests.
# Contributing

## Reporting a Bug
🎉🏅 Thanks for helping us improve this project! 🙏

Before reporting a bug,
make sure you are using the latest versions of cached.
This document outlines some of the practices we care about.
If you have any questions or suggestions about the process,
feel free to [open an issue](#reporting-issues).

When reporting a bug with cached,
please provide a minimal test case.
This can be a gist,
inline in the description,
or in the form of a pull request
that includes a failing test.
## How Can I Contribute?

If you are contributing a bug fix,
make sure it has a passing test
in your pull request.
### Reporting Issues

## Adding a Feature
If you find any mistakes in the docs or a bug in the code,
please [open an issue in Github](https://github.com/groupon/node-cached/issues/new) so we can look into it.
You can also [create a PR](#contributing-code) fixing it yourself, or course.

Before implementing features,
try to make sure that
(1) no one else is currently working on that and
(2) you have checked with the maintainers
that this is something they would like to see.
If you report a bug, please follow these guidelines:

All features should have tests.
* Make sure the bug exists in the latest version.
* Include instructions on how to reproduce the issue.
The instructions should be as minimal as possible
and answer the three big questions:
1. What are the exact steps you took? This includes the exact versions of node, npm, and any packages involved.
1. What result are you expecting?
1. What is the actual result?

### Improving Documentation

For small documentation changes, you can use [Github's editing feature](https://help.github.com/articles/editing-files-in-another-user-s-repository/).
The only thing to keep in mind is to prefix the commit message with "docs: ".
The detault commit message generated by Github will lead to a failing CI build.

For larger updates to the documentation
it might be better to follow the [instructions for contributing code below](#contributing-code).

### Contributing Code

**Note:** If you're planning on making substantial changes,
please [open an issue first to discuss your idea](#reporting-issues).
Otherwise you might end up investing a lot of work
only to discover that it conflicts with plans the maintainers might have.

The general steps for creating a pull request are:

1. Create a branch for your change.
Always start your branch from the latest `master`.
We often prefix the branch name with our initials, e.g. `jk-a-change`.
1. Run `npm install` to install the dependencies.
1. If you're fixing a bug, be sure to write a test *first*.
That way you can validate that the test actually catches the bug and doesn't pass.
1. Make your changes to the code.
Remember to update the tests if you add new features or change behavior.
1. Run the tests via `npm test`. This will also run style checks and other validations.
You might see errors about uncommitted files.
This is expected until you commit your changes.
1. Once you're done, `git add .` and `git commit`.
Please follow the [commit message conventions](#commits--commit-messages) described below.
1. Push your branch to Github & create a PR.

#### Code Style

In addition to any linting rules the project might include,
a few general rules of thumb:

* Try to match the style of the rest of the code.
* We prefer simple code that is easy to understand over terse, expressive code.
* We try to structure projects by semantics instead of role.
E.g. we'd rather have a `tree.js` module that contains tree traversal-related helpers
than a `helpers.js` module.
* Actually, if you create helpers you might want to put those into a separate package.
That way it's easier to reuse them.

#### Commits & Commit Messages

Please follow the [angular commit message conventions](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines).
We use an automated tool for generating releases
that depends on the conventions to determine the next version and the content of the changelog.
Commit messages that don't follow the conventions will cause `npm test` (and thus CI) to fail.

The short summary - a commit message should look like this:

```
<type>: <subject>
<body>
<references>
<footer>
```

Everything but the first line is optional.
The empty lines between the different parts are required.

* `<type>`: One of the following:
- **feat:** Introduces a new feature. This will cause the minor version to go up.
- **fix:** A bug fix. Causes a patch version bump.
- **docs:** Changes to the documentation.
This will also cause an increase of the patch version so that the changes show up in the npm registry.
- **style:** Cleanup & lint rule fixes.
Note that often it's better to just amend the previous commit if it introduced lint errors.
- **refactor:** Changes to the code structure without fixing bugs or adding features.
- **perf:** Performance optimizations.
- **test:** Fixing existing tests or adding missing ones.
Just like with **style**, if you add tests to a feature you just introduced in the previous commit,
consider keeping the tests and the feature in the same commit instead.
- **chore:** Changes to the project setup and tools, dependency bumps, house-keeping.
* `<subject>`: A [good git commit message subject](http://chris.beams.io/posts/git-commit/#limit-50).
- Keep it brief. If possible the whole first line should have at most 50 characters.
- Use imperative mood. "Create" instead of "creates" or "created".
- No period (".") at the end.
* `<body>`: Motivation for the change and any context required for understanding the choices made.
Just like the subject, it should use imperative mood.
* `<references>`: Any URLs relevant to the PR go here.
Use one line per URL and prefix it with the kind of relationship, e.g. "Closes: " or "See: ".
If you are referencing an issue in your commit body or PR description,
never use `#123` but the full URL to the issue or PR you are referencing.
That way the reference is easy to resolve from the git history without having to "guess" the correct link
even if the commit got cherry-picked or merged into a different project.
* `<footer>`: This part only applies if your commit introduces a breaking change.
It's important this is present, otherwise the major version will not increase.
See below for an example.

##### Examples

A feature that introduces a breaking change:

```
feat: Support --yes CLI option
For existing projects all prompts can be inferred automatically.
Manual confirmation for each default provides no value in that case.
Closes https://github.com/my/project/issues/123
BREAKING CHANGE: This removes support for interactive password entry.
Users will have to login beforehand.
```

A simple bug fix:

```
fix: Handle multi-byte characters in search logic
```
58 changes: 29 additions & 29 deletions lib/backend.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
/*
Copyright (c) 2014, Groupon, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of GROUPON nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Copyright (c) 2014, Groupon, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of GROUPON nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
'use strict';

Expand Down
60 changes: 29 additions & 31 deletions lib/backends/memcached.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
// Generated by CoffeeScript 1.10.0

/*
Copyright (c) 2014, Groupon, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of GROUPON nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Copyright (c) 2014, Groupon, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of GROUPON nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
'use strict';

Expand Down
Loading

0 comments on commit bdac8c6

Please sign in to comment.