inspecstyle 0.1.0 → 0.1.5

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 +56 -5
  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 +34 -0
  32. data/lib/rubocop/cop/inspecstyle/deprecated_attributes.rb +15 -14
  33. data/lib/rubocop/cop/inspecstyle/first_cop.rb +0 -1
  34. data/lib/rubocop/cop/inspecstyle/oracle_db_session_pass.rb +37 -0
  35. data/lib/rubocop/cop/inspecstyle/shadow_properties.rb +59 -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: e638a82024fe7f9482ea0f85766d10864e215739b29e46dd90cdde9977c9b7ee
4
- data.tar.gz: 2e07ab7f1a98d5e7820eb3a6b7af04814e4cc1ccd8ddd9d0b9b5207f167373c5
3
+ metadata.gz: bb076b244e5088e7e791398f5eb97c1e4605cfb1884f16926c77b950ff0227de
4
+ data.tar.gz: a5fa8c99dc4df14eb42e1af6af351e96cece0b8e3a38b06cad1b42cca7f9e124
5
5
  SHA512:
6
- metadata.gz: ba17616f81d48ed11ecc84a740973fced42aa2ef5c5833e6f407014337083179c4e597f71079d6afe635484e268ed8f5205d156a606245c413d79ed599e581df
7
- data.tar.gz: d2ff5b5d9da6786f15acb5afaa41a87e266a22551d627be464ae02fbe395324d1596a65f253da21cfb068f0a0afe33237f095910e487c313d3a03b8f8937e16b
6
+ metadata.gz: 0a2ff04f4194cae59aec606787a481529430883636c19d10324de5d45e579e842fe29ef5a8ecf2f67e6b61e2eb722d28bde84cc2c6ac073eebb8954fc16895ab
7
+ data.tar.gz: 3ced9b66232704943c40220b303ecefd7fd58d39b35c00d753d71f95e566ca9574dfff0bd8e7d60f3c2663503dafe1e88dc0d50bedec04555cb184960e30af90
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
@@ -1,8 +1,9 @@
1
- # Rubocop::InSpecStyle
1
+ # InSpecStyle
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
 
@@ -22,7 +23,57 @@ Or install it yourself as:
22
23
 
23
24
  ## Usage
24
25
 
25
- TODO: Write usage instructions here
26
+ InSpecStyle integrates with rubocop to lint your InSpec code.
27
+
28
+ ```yaml
29
+ #.rubocop.yml
30
+ require:
31
+ - inspecstyle
32
+ ```
33
+
34
+ This gem must be installed to use the [InSpecStyle atom linter package](https://atom.io/packages/inspecstyle).
35
+
36
+ To only run these cops on your local rubocop run, execute:
37
+
38
+ `rubocop . --only InSpecStyle`
39
+
40
+ ## TODO:
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
+ ```
26
77
 
27
78
  ## Development
28
79
 
@@ -32,7 +83,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
83
 
33
84
  ## Contributing
34
85
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/inspecstyle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/inspecstyle/blob/master/CODE_OF_CONDUCT.md).
86
+ Bug reports and pull requests are welcome on GitHub at https://github.com/schwad/inspecstyle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/schwad]/inspecstyle/blob/master/CODE_OF_CONDUCT.md).
36
87
 
37
88
 
38
89
  ## License
@@ -41,4 +92,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
41
92
 
42
93
  ## Code of Conduct
43
94
 
44
- Everyone interacting in the Rubocop::InSpecStyle project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/inspecstyle/blob/master/CODE_OF_CONDUCT.md).
95
+ Everyone interacting in the Rubocop::InSpecStyle project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/schwad/inspecstyle/blob/master/CODE_OF_CONDUCT.md).
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>