Skip to content

Commit b0a48fd

Browse files
committed
Open source commit
0 parents  commit b0a48fd

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

.codeclimate.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
engines:
2+
rubocop:
3+
enabled: true
4+
ratings:
5+
paths:
6+
- bin/codeclimate-watson

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM alpine:edge
2+
3+
WORKDIR /usr/src/app
4+
5+
RUN apk --update add nodejs git ruby ruby-dev build-base && \
6+
apk del build-base && rm -fr /usr/share/ri && \
7+
npm install -g mrb/ember-watson.git#4c382bd
8+
9+
COPY . /usr/src/app
10+
11+
CMD ["/usr/src/app/bin/codeclimate-watson"]

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015 Code Climate, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Code Climate ember-watson Engine
2+
3+
`codeclimate-watson` is a Code Climate engine that wraps [ember-watson](https://github.com/abuiles/ember-watson). You can run it on your command line using the Code Climate CLI, or on our hosted analysis platform.
4+
5+
### Installation & Usage
6+
7+
1. If you haven't already, [install the Code Climate CLI](https://github.com/codeclimate/codeclimate).
8+
2. Run `codeclimate engines:enable watson`. This command both installs the engine and enables it in your `.codeclimate.yml` file.
9+
3. You're ready to analyze! Browse into your project's folder and run `codeclimate analyze`.
10+
11+
### Need help?
12+
13+
For help with ember-watson, [check out their documentation](https://github.com/abuiles/ember-watson).
14+
15+
If you're running into a Code Climate issue, first look over this project's [GitHub Issues](https://github.com/codeclimate/codeclimate-watson/issues), as your question may have already been covered. If not, [go ahead and open a support ticket with us](https://codeclimate.com/help).

bin/codeclimate-watson

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'json'
4+
5+
def parse_engine_config(raw)
6+
raw ? JSON.parse(raw) : {}
7+
end
8+
9+
engine_config = parse_engine_config(ENV['ENGINE_CONFIG'])
10+
Dir.chdir("/code")
11+
cmd = "ember-watson"
12+
if exclude_paths = engine_config['exclude_paths']
13+
exclude_paths.each do |path|
14+
cmd << " -e #{path}"
15+
end
16+
end
17+
cmd << " -d all '.'"
18+
result = `#{cmd}`
19+
print result

0 commit comments

Comments
 (0)