-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to yarn for installing dependencies
This seems more intuitive to me today, and I hope will make it easier for contributors who want to add or upgrade plugins. Note: this is using nightly yarn, because there's a fix for Circle CI + Docker + Yarn compatibility that is made but not officially released yet. We can switch to stable yarn once 0.18.0 leaves pre-release. The fix was PR 1837 on the Yarn repo.
- Loading branch information
1 parent
6c4bfa4
commit 5fd86c5
Showing
6 changed files
with
1,224 additions
and
938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Contributing | ||
|
||
## Adding and upgrading plugins | ||
|
||
When adding or upgrading a plugin, we should see changes in both `package.json` | ||
and `yarn.lock`. | ||
|
||
Make sure to run `make image` before running these commands. | ||
|
||
Add a plugin: | ||
|
||
``` | ||
bin/yarn add eslint-config-google | ||
``` | ||
|
||
Upgrade a plugin: | ||
|
||
``` | ||
bin/yarn upgrade eslint-config-google | ||
``` | ||
|
||
## Testing Changes | ||
|
||
Changes made to the engine can be tested locally. | ||
|
||
1. Install [the CodeClimate CLI](https://github.com/codeclimate/codeclimate). | ||
1. Create the image (customizing the `IMAGE_NAME` as needed): | ||
```bash | ||
IMAGE_NAME=codeclimate/codeclimate-eslint-test make image | ||
``` | ||
1. Add the engine to your test `.codeclimate.yml`: | ||
```yaml | ||
engines: | ||
eslint-test: | ||
enabled: true | ||
``` | ||
1. Run analyze via the CLI: | ||
```bash | ||
codeclimate analyze --dev | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,13 @@ FROM node:6.3.1-slim | |
MAINTAINER Code Climate <[email protected]> | ||
|
||
WORKDIR /usr/src/app | ||
COPY npm-shrinkwrap.json /usr/src/app/ | ||
COPY package.json /usr/src/app/ | ||
COPY package.json yarn.lock /usr/src/app/ | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y git jq && \ | ||
npm install && \ | ||
RUN apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg && \ | ||
echo "deb http://nightly.yarnpkg.com/debian/ nightly main" | tee /etc/apt/sources.list.d/yarn-nightly.list && \ | ||
apt-get update && \ | ||
apt-get install -y git jq yarn && \ | ||
yarn install && \ | ||
git clone https://github.com/eslint/eslint.git && \ | ||
ESLINT_DOCS_VERSION=`npm -j ls eslint | jq -r .dependencies.eslint.version` && \ | ||
cd eslint && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
IMAGE_NAME=${IMAGE_NAME:-codeclimate/codeclimate-eslint} | ||
docker run --rm --volume "$PWD:/usr/src/app" "$IMAGE_NAME" sh -c "cd /usr/src/app && yarn $*" |
Oops, something went wrong.