Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use chefstyle 0.4.0 for linting and resolve all warnings #870

Merged
merged 15 commits into from
Aug 19, 2016

Conversation

lamont-granquist
Copy link
Contributor

fixing all the new enforcement with chefstyle 0.4.0

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
there's some voodoo going on here i don't want to figure out how to
unwind

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@@ -177,7 +177,7 @@ def popen4(cmd, args = {}, &b)
$VERBOSE = nil
ps.last.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)

cid = fork {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might as well fix it, but this is hopefully getting deleted soon

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubocop fixed it for me with -a

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
cpu[current_cpu]["stepping"] = processor["stepping"].nil? \
? processor["description"].match(/Stepping\s+(\d+)/)[1] \
: processor["stepping"]
cpu[current_cpu]["stepping"] = if processor["stepping"].nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Killing these multiline operators is fantastic. They're a real pain to read

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't see the one in chef/chef where someone used a multiline ternary and broke a string in the middle with \ in order to line wrap it and get it under 80 columns. completely unreadable omgwtfbbq.

this example is just from someone who didn't understand whitespace parsing and tokenization in ruby...

fixing some of these methods to be private (when they were intended
to be private but were actually public) broke tests.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lamont-granquist
Copy link
Contributor Author

this is actually passing but chefstyle is bitching about Lint/UnnededDisable which is a rule that i'll disable for chefstyle 0.4.0 to make this annoyance stop.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lamont-granquist lamont-granquist merged commit 8aa8eec into master Aug 19, 2016
@lamont-granquist lamont-granquist deleted the lcg/more-cops branch August 19, 2016 18:17
@tas50 tas50 changed the title chefstyle 0.4.0 Use chefstyle 0.4.0 and resolve all warnings Sep 7, 2016
@tas50 tas50 changed the title Use chefstyle 0.4.0 and resolve all warnings Use chefstyle 0.4.0 for linting and resolve all warnings Sep 7, 2016
@thommay thommay added Type: Enhancement Adds new functionality. and removed Enhancement labels Jan 24, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants