phutchins / chef-sar Goto Github PK
View Code? Open in Web Editor NEWInstall and enable sar
Install and enable sar
Philip,
When I search for "sar" on https://supermarket.chef.io I get two hits: sar and chef-sar. Both appear to be by you, but with different usernames. They appear to be similar in content, but only the sar one has a button to link to the source on GitHub.
I'm curious why that is. Can you share the background on why there are two cookbooks instead of just one? As a relative newcomer to the Chef community, I can't figure it out :-)
Thanks,
Linc
Philip,
At my company they encourage us to run the Ruby linting tool called "rubocop" (which comes with the ChefDK) on our cookbook Ruby files. In my limited experience with it, it's kind of a hassle to use because it's quite sensitive (it'll pick up tons of things that "ruby -c " doesn't care about). But I like it because it helps me write Ruby in what I'm hoping is a more standard and readable way.
As a practice for me as a newcomer to the Chef community, I propose to address these straightforward "rubocop offenses" in a pull request.
Linc Abbey
chef-sar (linc)$ pwd
/Users/linc/chef/chef-repo/cookbooks/chef-sar
chef-sar (linc)$ rubocop -n
warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.7-compliant syntax, but you are running 2.1.5.
Inspecting 3 files
C.C
Offenses:
metadata.rb:1:5: C: Put one space between the method name and the first argument.
name "sar"
^^^^^^^^^^^^^
metadata.rb:1:18: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
name "sar"
^^^^^
metadata.rb:2:11: C: Put one space between the method name and the first argument.
maintainer "Philip Hutchins"
^^^^^^^
metadata.rb:2:18: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
maintainer "Philip Hutchins"
^^^^^^^^^^^^^^^^^
metadata.rb:3:18: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
maintainer_email "[email protected]"
^^^^^^^^^^^^^^^^^^^^
metadata.rb:4:8: C: Put one space between the method name and the first argument.
license "Apache 2.0"
^^^^^^^^^^
metadata.rb:4:18: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
license "Apache 2.0"
^^^^^^^^^^^^
metadata.rb:5:12: C: Put one space between the method name and the first argument.
description "Installs/Configures sar"
^^^^^^
metadata.rb:5:18: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
description "Installs/Configures sar"
^^^^^^^^^^^^^^^^^^^^^^^^^
metadata.rb:7:8: C: Put one space between the method name and the first argument.
version "0.0.1"
^^^^^^^^^^
metadata.rb:7:18: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
version "0.0.1"
^^^^^^^
metadata.rb:9:1: C: %w-literals should be delimited by ( and )
%w{ ubuntu debian redhat centos scientific amazon fedora }.each do |os|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
metadata.rb:13:1: C: %w-literals should be delimited by ( and )
%w{ yum apt }.each do |ckbk|
^^^^^^^^^^^^^
recipes/default.rb:10:13: C: Redundant curly braces around a hash parameter.
variables({
^
recipes/default.rb:11:5: C: Use the new Ruby 1.9 hash syntax.
:sar_enabled => node['sar']['enabled'],
^^^^^^^^^^^^^^^
recipes/default.rb:11:5: C: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.
:sar_enabled => node['sar']['enabled'],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
recipes/default.rb:12:5: C: Use the new Ruby 1.9 hash syntax.
:sa1_options => node['sar']['sa1_options'],
^^^^^^^^^^^^^^^
recipes/default.rb:13:5: C: Use the new Ruby 1.9 hash syntax.
:sa2_options => node['sar']['sa2_options']
^^^^^^^^^^^^^^^
recipes/default.rb:14:3: C: Indent the right brace the same as the first position after the preceding left parenthesis.
})
^
recipes/default.rb:22:13: C: Redundant curly braces around a hash parameter.
variables({
^
recipes/default.rb:23:5: C: Use the new Ruby 1.9 hash syntax.
:run_every_minutes => node['sar']['cron']['run_every_minutes']
^^^^^^^^^^^^^^^^^^^^^
recipes/default.rb:23:5: C: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.
:run_every_minutes => node['sar']['cron']['run_every_minutes']
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
recipes/default.rb:24:3: C: Indent the right brace the same as the first position after the preceding left parenthesis.
})
^
3 files inspected, 23 offenses detected
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.