Skip to content

2.0: Rewrite in JavaScript #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
engines:
rubocop:
eslint:
enabled: true
ratings:
paths:
- "**.rb"
channel: eslint-4
exclude_paths:
- spec/**/*
- test/**/*
- node_modules/**/*
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.git
Makefile
node_modules
32 changes: 32 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"env": {
"node": true,
"mocha": true,
"es6": true
},
"rules": {
"block-spacing": 2,
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"comma-dangle": [2, "never"],
"comma-style": [2, "first", { exceptions: {ArrayExpression: true, ObjectExpression: true} }],
"complexity": [2, 6],
"curly": 2,
"eqeqeq": [2, "allow-null"],
"max-statements": [2, 30],
"no-shadow-restricted-names": 2,
"no-undef": 2,
"no-use-before-define": 2,
"radix": 2,
"semi": 2,
"space-infix-ops": 2,
"strict": 0
},
"globals": {
"AnalysisView": true,
"PollingView": true,
"Prism": true,
"Spinner": true,
"Timer": true,
"moment": true
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
41 changes: 0 additions & 41 deletions .rubocop.yml

This file was deleted.

1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

27 changes: 17 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
FROM codeclimate/alpine-ruby:b38
FROM node:alpine
LABEL maintainer="Code Climate <[email protected]>"

RUN adduser -u 9000 -D app

WORKDIR /usr/src/app
COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/

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

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

RUN adduser -u 9000 -D app
USER app
COPY . ./

COPY . /usr/src/app

USER app

VOLUME /code
WORKDIR /code

CMD ["/usr/src/app/bin/csslint"]
10 changes: 0 additions & 10 deletions Gemfile

This file was deleted.

44 changes: 0 additions & 44 deletions Gemfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ image:
docker build -t codeclimate/codeclimate-csslint .

test: image
docker run --rm codeclimate/codeclimate-csslint rspec $(RSPEC_ARGS)
docker run --rm codeclimate/codeclimate-csslint sh -c "cd /usr/src/app && npm run test"
5 changes: 0 additions & 5 deletions Rakefile

This file was deleted.

18 changes: 7 additions & 11 deletions bin/csslint
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), "../lib")))
#!/usr/local/bin/node --expose-gc

require 'cc/engine/csslint'
const fs = require("fs");
const Engine = require("../lib/csslint");

if File.exists?("/config.json")
engine_config = JSON.parse(File.read("/config.json"))
else
engine_config = {}
end
const CONFIG_PATH = "/config.json";
let config = JSON.parse(fs.readFileSync(CONFIG_PATH));

CC::Engine::CSSlint.new(
directory: "/code", engine_config: engine_config, io: STDOUT
).run
const CODE_DIR = "/code";
new Engine(CODE_DIR, console, config).run();
14 changes: 14 additions & 0 deletions bin/csslint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), "../lib")))

require 'cc/engine/csslint'

if File.exists?("/config.json")
engine_config = JSON.parse(File.read("/config.json"))
else
engine_config = {}
end

CC::Engine::CSSlint.new(
directory: "/code", engine_config: engine_config, io: STDOUT
).run
13 changes: 13 additions & 0 deletions engine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "CSSLint",
"description": "CSSLint is a tool to help point out problems with your CSS code.",
"maintainer": {
"name": "Code Climate",
"email": "[email protected]"
},
"languages": [
"CSS"
],
"version": "2.0.0",
"spec_version": "0.3.1"
}
92 changes: 0 additions & 92 deletions lib/cc/engine/csslint.rb

This file was deleted.

54 changes: 0 additions & 54 deletions lib/cc/engine/csslint/check_details.rb

This file was deleted.

Loading