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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61fc569ab86388138f45036d640001ea447cdbba
4
- data.tar.gz: 7ddc30ab8dde10379ad19733ae650450500c8c3c
3
+ metadata.gz: ba37a60a44edd281435dd050e77e16722f6a0514
4
+ data.tar.gz: 9a28b8d37f16fda841da9decd14f3590467f81a8
5
5
  SHA512:
6
- metadata.gz: 74162f36cc2fd428a9033237d6924acfc9232ddc05ced0b3f8c3d4ecff189c3a4a3a86bf71f48f11b760adfdbacf13bc8235cc1f814d7106fe20b84fa92d0487
7
- data.tar.gz: cc1e1cb6f188f83d8421175c1f4cd6b658e352e0f9d5c9a4987f53b40f6f59f657e4dc7488bc7327b0d1c278c38ebc02cd98cc6c186a595ad249e865de35519f
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
- if filesystem.exist?("vendor")
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
@@ -1,5 +1,6 @@
1
1
  require "active_support"
2
2
  require "active_support/core_ext"
3
+ require "safe_yaml"
3
4
 
4
5
  module CC
5
6
  module CLI
@@ -16,6 +17,8 @@ module CC
16
17
  end
17
18
 
18
19
  def initialize(args)
20
+ SafeYAML::OPTIONS[:default_mode] = :safe
21
+
19
22
  @args = args
20
23
  end
21
24
 
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.5
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-19 00:00:00.000000000 Z
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