Skip to content

Commit 90761f0

Browse files
authored
Merge pull request #39 from codeclimate/node
2.0: Rewrite in JavaScript
2 parents 8f3aed0 + 5899409 commit 90761f0

27 files changed

+828
-403
lines changed

.codeclimate.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
engines:
2-
rubocop:
2+
eslint:
33
enabled: true
4-
ratings:
5-
paths:
6-
- "**.rb"
4+
channel: eslint-4
75
exclude_paths:
8-
- spec/**/*
6+
- test/**/*
7+
- node_modules/**/*

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.git
22
Makefile
3+
node_modules

.eslintrc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"mocha": true,
5+
"es6": true
6+
},
7+
"rules": {
8+
"block-spacing": 2,
9+
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
10+
"comma-dangle": [2, "never"],
11+
"comma-style": [2, "first", { exceptions: {ArrayExpression: true, ObjectExpression: true} }],
12+
"complexity": [2, 6],
13+
"curly": 2,
14+
"eqeqeq": [2, "allow-null"],
15+
"max-statements": [2, 30],
16+
"no-shadow-restricted-names": 2,
17+
"no-undef": 2,
18+
"no-use-before-define": 2,
19+
"radix": 2,
20+
"semi": 2,
21+
"space-infix-ops": 2,
22+
"strict": 0
23+
},
24+
"globals": {
25+
"AnalysisView": true,
26+
"PollingView": true,
27+
"Prism": true,
28+
"Spinner": true,
29+
"Timer": true,
30+
"moment": true
31+
}
32+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.rubocop.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1-
FROM codeclimate/alpine-ruby:b38
1+
FROM node:alpine
2+
LABEL maintainer="Code Climate <hello@codeclimate.com>"
3+
4+
RUN adduser -u 9000 -D app
25

36
WORKDIR /usr/src/app
4-
COPY Gemfile /usr/src/app/
5-
COPY Gemfile.lock /usr/src/app/
67

7-
RUN apk --update add nodejs git zlib zlib-dev ruby ruby-dev ruby-bundler less build-base && \
8-
bundle install -j 4 && \
9-
apk del --purge build-base zlib zlib-dev && rm -fr /usr/share/ri
8+
COPY package.json yarn.lock engine.json ./
109

11-
ENV CSSLINT_SHA=87aa604a4cbc5125db979576f1b09b35980fcf08
12-
RUN npm install -g codeclimate/csslint.git#$CSSLINT_SHA
10+
RUN yarn install && \
11+
chown -R app:app ./ && \
12+
apk add --no-cache --virtual .dev-deps jq && \
13+
export csslint_version=$(yarn --json list --pattern csslint 2>/dev/null | jq -r '.data.trees[0].name' | cut -d@ -f2) && \
14+
cat engine.json | jq '.version = .version + "/" + env.csslint_version' > /engine.json && \
15+
apk del .dev-deps
1316

14-
RUN adduser -u 9000 -D app
15-
USER app
17+
COPY . ./
1618

1719
COPY . /usr/src/app
1820

21+
USER app
22+
23+
VOLUME /code
24+
WORKDIR /code
25+
1926
CMD ["/usr/src/app/bin/csslint"]

Gemfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

Gemfile.lock

Lines changed: 0 additions & 44 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ image:
44
docker build -t codeclimate/codeclimate-csslint .
55

66
test: image
7-
docker run --rm codeclimate/codeclimate-csslint rspec $(RSPEC_ARGS)
7+
docker run --rm codeclimate/codeclimate-csslint sh -c "cd /usr/src/app && npm run test"

0 commit comments

Comments
 (0)