WIP: This gem is not live, but we would love your help and input! Core issue here: https://github.com/inspec/inspec/issues/5095
InSpecStyle
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.
Full Documentation
https://rubydoc.info/gems/inspecstyle
Installation
Add this line to your application's Gemfile:
gem 'inspecstyle', require: false
And then execute:
$ bundle install
Or install it yourself as:
$ gem install inspecstyle
Usage
InSpecStyle integrates with rubocop to lint your InSpec code.
#.rubocop.yml
require:
- inspecstyle
This gem must be installed to use the InSpecStyle atom linter package.
To only run these cops on your local rubocop run, execute:
rubocop . --only InSpecStyle
TODO:
- Instead of referencing issues in the cops, point to a general
inspecstyle.guide
- Known issue, resources that work on manual runs but not in
atom
package: [- AzureGenericResource ]
- Cop ideas:
``
its('minimum_days_between_password_change') { should eq 0 } becomes 'mindays' its('maximum_days_between_password_change') { should eq 0 } becomes 'maxdays' Inspec.deprecate(:resource_user_serverspec_compat, "The user resource
has_home_directory?matcher is deprecated. Please use
its('home').") Inspec.deprecate(:resource_user_serverspec_compat, "The user resource
has_authorized_key?` matcher is deprecated. There is no currently implemented alternative")
shadow resource deprecations (e.g.) describe shadow('/etc/my-custom-place/shadow') do its('count') { should eq 32 } end
property deprecations:
user -> users password -> passwords last_change -> last_changes expiry_date -> expiry_dates lines (no replacement)
e.g.
sql = oracledb_session(user: 'my_user', pass: 'password') describe sql.query(\"SELECT UPPER(VALUE) AS VALUE FROM V$PARAMETER WHERE UPPER(NAME)='AUDIT_SYS_OPERATIONS'\").row(0).column('value') do its('value') { should eq 'TRUE' } end
oracledb_session deprecated pass
, use password
instead
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
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).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
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).