codeclimate 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/check +17 -0
- data/config/engines.yml +12 -0
- data/lib/cc/cli/init.rb +13 -3
- data/lib/cc/cli/runner.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba37a60a44edd281435dd050e77e16722f6a0514
|
4
|
+
data.tar.gz: 9a28b8d37f16fda841da9decd14f3590467f81a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90374bbb58e108f2274cbc309f36dd7b11df79bc112305a4c16bfacc24fbb96e3fa5f4a447f3f199d5d278919177bc7481d1e6c10ed732738e0e04e8bdd7d40
|
7
|
+
data.tar.gz: 6426603549d94d7cef952718e8e28bed4b0ee9af2aaa33671f53391401d9ed738b40f595a9e347135234f8770f7eda2cdbff38552e525d4198ad8b973800c5f4
|
data/bin/check
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
command -v docker > /dev/null 2>&1 || {
|
3
|
+
echo "Unable to find \`docker' on your \$PATH, is it installed?" >&2
|
4
|
+
exit 1
|
5
|
+
}
|
6
|
+
|
7
|
+
docker version | grep -Fq "Server version" || {
|
8
|
+
echo "Unable to run \`docker version', the docker daemon may not be running" >&2
|
9
|
+
|
10
|
+
if command -v boot2docker > /dev/null 2>&1; then
|
11
|
+
echo "Please ensure \`boot2docker up' succeeds and you've run \`boot2docker shellinit' in this shell" >&2
|
12
|
+
else
|
13
|
+
echo "Please ensure \`docker version' succeeds and try again"
|
14
|
+
fi
|
15
|
+
|
16
|
+
exit 1
|
17
|
+
}
|
data/config/engines.yml
CHANGED
@@ -93,3 +93,15 @@ bundler-audit:
|
|
93
93
|
- Gemfile.lock
|
94
94
|
default_ratings_paths:
|
95
95
|
- Gemfile.lock
|
96
|
+
phpcodesniffer:
|
97
|
+
image_name: codeclimate/codeclimate-phpcodesniffer
|
98
|
+
description: PHP Linting
|
99
|
+
community: false
|
100
|
+
enable_regexps:
|
101
|
+
- \.php$
|
102
|
+
- \.module$
|
103
|
+
- \.inc$
|
104
|
+
default_ratings_paths:
|
105
|
+
- "**.php"
|
106
|
+
- "**.module"
|
107
|
+
- "**.inc"
|
data/lib/cc/cli/init.rb
CHANGED
@@ -3,6 +3,8 @@ module CC
|
|
3
3
|
class Init < Command
|
4
4
|
include CC::Analyzer
|
5
5
|
|
6
|
+
AUTO_EXCLUDE_PATHS = %w[config db features node_modules script spec test vendor].freeze
|
7
|
+
|
6
8
|
def run
|
7
9
|
if filesystem.exist?(CODECLIMATE_YAML)
|
8
10
|
say "Config file .codeclimate.yml already present.\nTry running 'validate-config' to check configuration."
|
@@ -26,13 +28,21 @@ module CC
|
|
26
28
|
config["ratings"]["paths"] |= engine_config["default_ratings_paths"]
|
27
29
|
end
|
28
30
|
|
29
|
-
|
30
|
-
config["exclude_paths"] = ["vendor/**/*"]
|
31
|
-
end
|
31
|
+
config["exclude_paths"] = exclude_paths(AUTO_EXCLUDE_PATHS)
|
32
32
|
|
33
33
|
File.write(filesystem.path_for(CODECLIMATE_YAML), config.to_yaml)
|
34
34
|
end
|
35
35
|
|
36
|
+
def exclude_paths(paths)
|
37
|
+
expanded_paths = []
|
38
|
+
paths.each do |dir|
|
39
|
+
if filesystem.exist?(dir)
|
40
|
+
expanded_paths << "#{dir}/**/*"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
expanded_paths
|
44
|
+
end
|
45
|
+
|
36
46
|
def engine_eligible?(engine)
|
37
47
|
!engine["community"] &&
|
38
48
|
engine["enable_regexps"].present? &&
|
data/lib/cc/cli/runner.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -192,6 +192,7 @@ executables: []
|
|
192
192
|
extensions: []
|
193
193
|
extra_rdoc_files: []
|
194
194
|
files:
|
195
|
+
- bin/check
|
195
196
|
- bin/codeclimate
|
196
197
|
- config/engines.yml
|
197
198
|
- lib/cc/analyzer.rb
|