onceover-codequality 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05b4b045d5c1f2c0629b1491cbb69b297e0cf81febbc48e9ea0f0a3257f94ca5
4
- data.tar.gz: d185ea9bdb68f25b039c0fa075029af670e74b53269d44618b14bdca75e60b54
3
+ metadata.gz: fe144a873aa69c717b5753eb7a3b4abb152c591141f592d19561b3a438d5e492
4
+ data.tar.gz: 35d0b274abb8378261972c94814aa05bf9c85f0f6db98dbbaae2ab1ea29c7689
5
5
  SHA512:
6
- metadata.gz: ffca9f5955db6be466d3d62400c07123bf00c07f05685263abd3f269604f872ab83907a22dac60f87a0c24f12ccfb6ff9571d83d7b60f2e5295a095b1c891390
7
- data.tar.gz: d282f5b85bb63312bd89747f3c1c64a317830405b368c3faf44057f18c137d01ba3c7bbce444db34dc56051942eb160e239d71b784f6f7ad284a5ee145ed2d5c
6
+ metadata.gz: f4b9529fcf02d3ae4b769a4a09723216f94c7aa78d3461dd8fa33b9bd562ddf6dd061732102977c4916fc55544cff9eb8e6624402aaa1e0e92398d32baa50437
7
+ data.tar.gz: a99f4b38979decc2f7fc9295e9374a9cd15db03a906bdfa46f15491ab63562f88248b4ec513be7b0fb42e8f7496d7799ccdc898bba38f2da3c5b477899f7fcb4
data/README.md CHANGED
@@ -57,6 +57,11 @@ $ onceover run codequality --no_puppetfile
57
57
  $ onceover run codequality --no_doc
58
58
  ```
59
59
 
60
+ **Use custom lint settings**
61
+ Create a file `puppet-lint.rc` in the directory you run `onceover codequality`
62
+ from and it will be automatically used by Puppet Lint. If missing, the built-in
63
+ defaults from `lib/onceover/codequality/lint.rb` will be used.
64
+
60
65
 
61
66
  ## Sample output
62
67
 
@@ -28,6 +28,15 @@ class Onceover
28
28
  no_puppetfile = opts[:no_puppetfile] || false
29
29
  html_docs = opts[:html_docs] || false
30
30
  status = true
31
+
32
+ if ! no_syntax
33
+ logger.info "Checking syntax..."
34
+ if ! Onceover::CodeQuality::Syntax.puppet
35
+ status = false
36
+ logger.error "Syntax test failed, see previous errors"
37
+ end
38
+ end
39
+
31
40
  if ! no_lint
32
41
  logger.info "Checking for lint..."
33
42
  if ! Onceover::CodeQuality::Lint.puppet
@@ -44,14 +53,6 @@ class Onceover
44
53
  end
45
54
  end
46
55
 
47
- if ! no_syntax
48
- logger.info "Checking syntax..."
49
- if ! Onceover::CodeQuality::Syntax.puppet
50
- status = false
51
- logger.error "Syntax test failed, see previous errors"
52
- end
53
- end
54
-
55
56
  if ! no_docs
56
57
  logger.info "Generating documentation..."
57
58
  if ! Onceover::CodeQuality::Docs.puppet_strings(html_docs)
@@ -7,14 +7,19 @@ class Onceover
7
7
  "manifests",
8
8
  ].concat(Dir.glob('site/*').select {|f| File.directory? f})
9
9
 
10
- LINT_OPTIONS = [
11
- "--relative",
12
- "--fail-on-warnings",
13
- "--no-double_quoted_strings-check",
14
- "--no-80chars-check",
15
- "--no-variable_scope-check",
16
- "--no-quoted_booleans-check",
17
- ]
10
+ # use our default options unless user has created own settings
11
+ if ! File.exist? ".puppet-lint.rc"
12
+ LINT_OPTIONS = [
13
+ "--relative",
14
+ "--fail-on-warnings",
15
+ "--no-double_quoted_strings-check",
16
+ "--no-80chars-check",
17
+ "--no-variable_scope-check",
18
+ "--no-quoted_booleans-check",
19
+ ].freeze
20
+ else
21
+ LINT_OPTIONS = [].freeze
22
+ end
18
23
 
19
24
  def self.puppet
20
25
  status = true
@@ -1,5 +1,5 @@
1
1
  class Onceover
2
2
  module CodeQuality
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onceover-codequality
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Declarative Systems
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler