inspecstyle 0.1.1 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +12 -7
  5. data/README.md +36 -1
  6. data/Rakefile +3 -0
  7. data/config/default.yml +18 -0
  8. data/doc/RuboCop.html +128 -0
  9. data/doc/RuboCop/Cop.html +117 -0
  10. data/doc/RuboCop/Cop/InSpecStyle.html +117 -0
  11. data/doc/RuboCop/Cop/InSpecStyle/AzureGenericResource.html +249 -0
  12. data/doc/RuboCop/Cop/InSpecStyle/DeprecatedAttributes.html +310 -0
  13. data/doc/RuboCop/Cop/InSpecStyle/FirstCop.html +345 -0
  14. data/doc/RuboCop/InSpecStyle.html +140 -0
  15. data/doc/RuboCop/InSpecStyle/Error.html +124 -0
  16. data/doc/RuboCop/InSpecStyle/Inject.html +195 -0
  17. data/doc/_index.html +211 -0
  18. data/doc/class_list.html +51 -0
  19. data/doc/css/common.css +1 -0
  20. data/doc/css/full_list.css +58 -0
  21. data/doc/css/style.css +496 -0
  22. data/doc/file.README.html +131 -0
  23. data/doc/file_list.html +56 -0
  24. data/doc/frames.html +17 -0
  25. data/doc/index.html +131 -0
  26. data/doc/js/app.js +314 -0
  27. data/doc/js/full_list.js +216 -0
  28. data/doc/js/jquery.js +4 -0
  29. data/doc/method_list.html +99 -0
  30. data/doc/top-level-namespace.html +110 -0
  31. data/lib/rubocop/cop/inspecstyle/azure_generic_resource.rb +35 -0
  32. data/lib/rubocop/cop/inspecstyle/deprecated_attributes.rb +17 -15
  33. data/lib/rubocop/cop/inspecstyle/first_cop.rb +0 -1
  34. data/lib/rubocop/cop/inspecstyle/oracle_db_session_pass.rb +38 -0
  35. data/lib/rubocop/cop/inspecstyle/shadow_properties.rb +61 -0
  36. data/lib/rubocop/cop/inspecstyle_cops.rb +3 -0
  37. data/lib/rubocop/inspecstyle/version.rb +1 -1
  38. data/notes-for-development.md +3 -0
  39. data/tasks/cops_documentation.rake +300 -0
  40. metadata +29 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcb9ee68a7dd29338399f6b60bbde2a0b1e74eb0e92729a7e3f217d3260f0a08
4
- data.tar.gz: 1e91471f1ce7c21d657a1dffdeddb3d0f8fb277162e9ddc469655ae117e2216c
3
+ metadata.gz: 9c05d8e13dc59b97ef50ee7e38f9e728dc3e52ade3e648c4dc73241d3f32d60f
4
+ data.tar.gz: be29a3ae8643a818ef62e7f0a491cc161940b9a675641ae34343cdc082470ec2
5
5
  SHA512:
6
- metadata.gz: 8b0845a3f7b8fc29a3c37e7cf2afbfceb31135693757ab07a84c53e1f9966e70d61cff79118a42cf6c7fb80ed1c5dc58cd67f41f61f7300a86f34ec1ae53388e
7
- data.tar.gz: d2b938a1bb46dac3a32d805b303a52606536d9a750459fae7afea3110b19d478f34ff59fc01fb9ef67ca6fae88b0e06b3be3f949be8f77f3276e9c7d8273b154
6
+ metadata.gz: 460c48ff0252cbfff1fb0a1b0245366eba8ae3ed939c03dc418a0561ce9d8d31fc8d9beefaf941fe24ea93f52681057104e6ec8863b58b248399ea1072c7a3dd
7
+ data.tar.gz: e8bb21c13461a344f7ed3b75ef55634755adb454d0530672024ef8fb60d15fdfb3d0c06aedb60322ca864e7520f88cc65e4913979d5a76051467e3f44dafe49a
data/.gitignore CHANGED
@@ -2,7 +2,7 @@
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /coverage/
5
- /doc/
6
5
  /pkg/
7
6
  /spec/reports/
8
7
  /tmp/
8
+ *.gem
data/Gemfile CHANGED
@@ -6,3 +6,4 @@ gemspec
6
6
  gem "rake", "~> 12.0"
7
7
  gem "minitest", "~> 5.0"
8
8
  gem 'rspec'
9
+ gem 'yard'
@@ -1,21 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- inspecstyle (0.1.0)
4
+ inspecstyle (0.1.3)
5
5
  rubocop
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.0)
10
+ ast (2.4.1)
11
11
  diff-lcs (1.3)
12
- jaro_winkler (1.5.4)
13
12
  minitest (5.14.1)
14
13
  parallel (1.19.1)
15
- parser (2.7.1.2)
14
+ parser (2.7.1.3)
16
15
  ast (~> 2.4.0)
17
16
  rainbow (3.0.0)
18
17
  rake (12.3.3)
18
+ regexp_parser (1.7.1)
19
19
  rexml (3.2.4)
20
20
  rspec (3.9.0)
21
21
  rspec-core (~> 3.9.0)
@@ -30,25 +30,30 @@ GEM
30
30
  diff-lcs (>= 1.2.0, < 2.0)
31
31
  rspec-support (~> 3.9.0)
32
32
  rspec-support (3.9.3)
33
- rubocop (0.81.0)
34
- jaro_winkler (~> 1.5.1)
33
+ rubocop (0.85.1)
35
34
  parallel (~> 1.10)
36
35
  parser (>= 2.7.0.1)
37
36
  rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.7)
38
38
  rexml
39
+ rubocop-ast (>= 0.0.3)
39
40
  ruby-progressbar (~> 1.7)
40
41
  unicode-display_width (>= 1.4.0, < 2.0)
42
+ rubocop-ast (0.0.3)
43
+ parser (>= 2.7.0.1)
41
44
  ruby-progressbar (1.10.1)
42
45
  unicode-display_width (1.7.0)
46
+ yard (0.9.25)
43
47
 
44
48
  PLATFORMS
45
49
  ruby
46
50
 
47
51
  DEPENDENCIES
52
+ inspecstyle!
48
53
  minitest (~> 5.0)
49
54
  rake (~> 12.0)
50
55
  rspec
51
- inspecstyle!
56
+ yard
52
57
 
53
58
  BUNDLED WITH
54
59
  2.1.4
data/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rubocop/inspecstyle`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ## Full Documentation
6
+ https://rubydoc.info/gems/inspecstyle
6
7
 
7
8
  ## Installation
8
9
 
@@ -39,6 +40,40 @@ To only run these cops on your local rubocop run, execute:
39
40
  ## TODO:
40
41
 
41
42
  - Instead of referencing issues in the cops, point to a general `inspecstyle.guide`
43
+ - Known issue, resources that work on manual runs but not in `atom` package: [
44
+ - AzureGenericResource
45
+ ]
46
+ - Cop ideas:
47
+ ```
48
+ its('minimum_days_between_password_change') { should eq 0 } becomes 'mindays'
49
+ its('maximum_days_between_password_change') { should eq 0 } becomes 'maxdays'
50
+ Inspec.deprecate(:resource_user_serverspec_compat, "The user resource `has_home_directory?` matcher is deprecated. Please use `its('home')`.")
51
+ Inspec.deprecate(:resource_user_serverspec_compat, "The user resource `has_authorized_key?` matcher is deprecated. There is no currently implemented alternative")
52
+
53
+
54
+ shadow resource deprecations
55
+ (e.g.)
56
+ describe shadow('/etc/my-custom-place/shadow') do
57
+ its('count') { should eq 32 }
58
+ end
59
+
60
+ property deprecations:
61
+
62
+ user -> users
63
+ password -> passwords
64
+ last_change -> last_changes
65
+ expiry_date -> expiry_dates
66
+ lines (no replacement)
67
+
68
+ e.g.
69
+
70
+ sql = oracledb_session(user: 'my_user', pass: 'password')
71
+ describe sql.query(\"SELECT UPPER(VALUE) AS VALUE FROM V$PARAMETER WHERE UPPER(NAME)='AUDIT_SYS_OPERATIONS'\").row(0).column('value') do
72
+ its('value') { should eq 'TRUE' }
73
+ end
74
+
75
+ oracledb_session deprecated `pass`, use `password` instead
76
+ ```
42
77
 
43
78
  ## Development
44
79
 
data/Rakefile CHANGED
@@ -15,6 +15,9 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
15
15
  spec.pattern = FileList['spec/**/*_spec.rb']
16
16
  end
17
17
 
18
+ require 'yard'
19
+ YARD::Rake::YardocTask.new
20
+
18
21
  desc 'Generate a new cop with a template'
19
22
  task :new_cop, [:cop] do |_task, args|
20
23
  require 'rubocop'
@@ -1,7 +1,25 @@
1
+ InSpecStyle/AzureGenericResource:
2
+ Description: 'Do not use azure_generic_resource'
3
+ Enabled: true
4
+ VersionAdded: '0.82'
5
+ StyleGuide: 'https://github.com/inspec/inspec/issues/3131'
6
+
1
7
  InSpecStyle/DeprecatedAttributes:
2
8
  Description: 'Attributes are deprecated in favor of inputs'
3
9
  Enabled: true
4
10
  VersionAdded: '0.82'
11
+ StyleGuide: 'https://github.com/inspec/inspec/issues/3802'
12
+ PreferredReplacement: 'input'
13
+
14
+ InSpecStyle/OracleDbSessionPass:
15
+ Description: 'Use `pass` instead of `password`'
16
+ Enabled: true
17
+ VersionAdded: '0.82'
18
+
19
+ InSpecStyle/ShadowProperties:
20
+ Description: '`user` attribute for shadow resources is deprecated for `users`'
21
+ Enabled: true
22
+ VersionAdded: '0.82'
5
23
 
6
24
  InspecStyle/FirstCop:
7
25
  Description: 'This first cop is a sandbox for exploring new InspecStyle cops.'
@@ -0,0 +1,128 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: RuboCop
8
+
9
+ &mdash; Documentation by YARD 0.9.25
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "RuboCop";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (R)</a> &raquo;
40
+
41
+
42
+ <span class="title">RuboCop</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: RuboCop
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/rubocop/inspecstyle/inject.rb<span class="defines">,<br />
82
+ lib/rubocop/inspecstyle.rb,<br /> lib/rubocop/inspecstyle/version.rb,<br /> lib/rubocop/cop/inspecstyle/first_cop.rb,<br /> lib/rubocop/cop/inspecstyle/deprecated_attributes.rb,<br /> lib/rubocop/cop/inspecstyle/azure_generic_resource.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Overview</h2><div class="docstring">
89
+ <div class="discussion">
90
+
91
+ <p>TODO: when finished, run `rake generate_cops_documentation` to update the docs</p>
92
+
93
+
94
+ </div>
95
+ </div>
96
+ <div class="tags">
97
+
98
+
99
+ </div><h2>Defined Under Namespace</h2>
100
+ <p class="children">
101
+
102
+
103
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="RuboCop/Cop.html" title="RuboCop::Cop (module)">Cop</a></span>, <span class='object_link'><a href="RuboCop/InSpecStyle.html" title="RuboCop::InSpecStyle (module)">InSpecStyle</a></span>
104
+
105
+
106
+
107
+
108
+ </p>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ </div>
119
+
120
+ <div id="footer">
121
+ Generated on Thu Jun 11 11:57:48 2020 by
122
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
+ 0.9.25 (ruby-2.6.6).
124
+ </div>
125
+
126
+ </div>
127
+ </body>
128
+ </html>
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: RuboCop::Cop
8
+
9
+ &mdash; Documentation by YARD 0.9.25
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "RuboCop::Cop";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../RuboCop.html" title="RuboCop (module)">RuboCop</a></span></span>
41
+ &raquo;
42
+ <span class="title">Cop</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: RuboCop::Cop
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/rubocop/cop/inspecstyle/first_cop.rb<span class="defines">,<br />
82
+ lib/rubocop/cop/inspecstyle/deprecated_attributes.rb,<br /> lib/rubocop/cop/inspecstyle/azure_generic_resource.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Defined Under Namespace</h2>
89
+ <p class="children">
90
+
91
+
92
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Cop/InSpecStyle.html" title="RuboCop::Cop::InSpecStyle (module)">InSpecStyle</a></span>
93
+
94
+
95
+
96
+
97
+ </p>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ </div>
108
+
109
+ <div id="footer">
110
+ Generated on Thu Jun 11 11:57:48 2020 by
111
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
+ 0.9.25 (ruby-2.6.6).
113
+ </div>
114
+
115
+ </div>
116
+ </body>
117
+ </html>
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: RuboCop::Cop::InSpecStyle
8
+
9
+ &mdash; Documentation by YARD 0.9.25
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "RuboCop::Cop::InSpecStyle";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (I)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../RuboCop.html" title="RuboCop (module)">RuboCop</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Cop.html" title="RuboCop::Cop (module)">Cop</a></span></span>
41
+ &raquo;
42
+ <span class="title">InSpecStyle</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: RuboCop::Cop::InSpecStyle
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/rubocop/cop/inspecstyle/first_cop.rb<span class="defines">,<br />
82
+ lib/rubocop/cop/inspecstyle/deprecated_attributes.rb,<br /> lib/rubocop/cop/inspecstyle/azure_generic_resource.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Defined Under Namespace</h2>
89
+ <p class="children">
90
+
91
+
92
+
93
+
94
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="InSpecStyle/AzureGenericResource.html" title="RuboCop::Cop::InSpecStyle::AzureGenericResource (class)">AzureGenericResource</a></span>, <span class='object_link'><a href="InSpecStyle/DeprecatedAttributes.html" title="RuboCop::Cop::InSpecStyle::DeprecatedAttributes (class)">DeprecatedAttributes</a></span>, <span class='object_link'><a href="InSpecStyle/FirstCop.html" title="RuboCop::Cop::InSpecStyle::FirstCop (class)">FirstCop</a></span>
95
+
96
+
97
+ </p>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ </div>
108
+
109
+ <div id="footer">
110
+ Generated on Thu Jun 11 11:57:48 2020 by
111
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
+ 0.9.25 (ruby-2.6.6).
113
+ </div>
114
+
115
+ </div>
116
+ </body>
117
+ </html>