Skip to content

Rubocop Implementation #838

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

Merged
merged 4 commits into from
Nov 20, 2017
Merged

Conversation

david22swan
Copy link
Member

A commit for the purpose of tracking changes

@david22swan david22swan changed the title RubocopTrackingCommit Rubocop Changes Nov 10, 2017
@david22swan
Copy link
Member Author

As a note, I have divided the ruby_spec.rb into three as I found it to unwieldy to use.

@david22swan david22swan changed the title Rubocop Changes Rubocop Changes Pending (Make no Merges) Nov 14, 2017
@david22swan david22swan changed the title Rubocop Changes Pending (Make no Merges) Rubocop Implementation Nov 14, 2017
@david22swan
Copy link
Member Author

Finished and Waiting on lean release

@david22swan
Copy link
Member Author

Ready for merge

@pmcmaw
Copy link
Contributor

pmcmaw commented Nov 17, 2017

LGTM. Another +1 and I will get it merged 👍

@HelenCampbell HelenCampbell merged commit 7999ff2 into puppetlabs:master Nov 20, 2017
@sean797
Copy link
Contributor

sean797 commented Nov 22, 2017

@david22swan david22swan deleted the Rubocop branch November 22, 2017 11:08
@david22swan
Copy link
Member Author

A fix has been merged in.
#850
Apologies for any inconvenience

@pmcmaw
Copy link
Contributor

pmcmaw commented Nov 22, 2017

@sean797 I have created the following PR which should resolve your issue. Just waiting on it going through CI and I will get it merged as soon as possible. If this does not resolve your issue please let me know as soon as possible.

:-)

#850

@matejzero
Copy link

matejzero commented Nov 27, 2017

I just found out, this broke stdlib on CentOS 6 with puppet 3.8, which still has ruby 1.8.

I opened a ticket on JIRA: https://tickets.puppetlabs.com/browse/MODULES-6107

Problem is the hash syntax.

@razorsedge
Copy link

Puppet 2.7.26 and 3.x with Ruby 1.8.7 is still broken.
https://travis-ci.org/razorsedge/puppet-snmp/builds/326051819

  155) snmp::snmpv3_user on a supported osfamily, Suse with snmptrapd settings should contain Exec[create-snmpv3-user-myTRAPuser] with before => "Service[snmptrapd]", command => "service snmptrapd stop ; sleep 5 ; echo \"createUser myTRAPuser SHA \\\"myauthpass\\\"\" >>/var/lib/net-snmp/snmptrapd.conf && touch /var/lib/net-snmp/myTRAPuser-snmptrapd", require => ["Package[snmpd]", "File[var-net-snmp]"] and creates => "/var/lib/net-snmp/myTRAPuser-snmptrapd"
     Failure/Error: )}
     Puppet::Error:
       Could not autoload puppet/parser/functions/validate_numeric: /home/travis/build/razorsedge/puppet-snmp/spec/fixtures/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb:62: syntax error, unexpected '>'
           validator = ->(num) do
                         ^
       /home/travis/build/razorsedge/puppet-snmp/spec/fixtures/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb:62: syntax error, unexpected kDO, expecting kEND
       /home/travis/build/razorsedge/puppet-snmp/spec/fixtures/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb:99: syntax error, unexpected kEND, expecting $end on node travis-job-razorsedge-puppet-snmp-326051820.travisci.net
     # ./spec/defines/snmp_snmpv3_user_spec.rb:251

@matejzero
Copy link

matejzero commented Jan 7, 2018

I think you are right!

This is the diff for Rubocop implementation, that dropped Ruby 1.8 support.

And this is the rollback diff. There seem to a be a lot of thinks missing.

Strangely I'm not hitting those issues for some reason, although I'm also using validate_integer/array/hash/book (not numeric though).

@natebc
Copy link

natebc commented May 11, 2018

Confirmed that the Rubocop implementation lead to some changes that didn't get rolled back.
Relevant bits are:
RHEL 6.9 puppet servers with:

puppet-3.8.7-1.el6.noarch
ruby-1.8.7.374-5.el6.x86_64
using puppetlab-stdlib-4.25.1

We hit the same error as @razorsedge

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/parser/functions/validate_integer: /etc/puppet/environments/development/modules/stdlib/lib/puppet/parser/functions/validate_integer.rb:100: syntax error, unexpected '>'
    validator = ->(num) do
                  ^
/etc/puppet/environments/development/modules/stdlib/lib/puppet/parser/functions/validate_integer.rb:100: syntax error, unexpected kDO, expecting kEND
/etc/puppet/environments/development/modules/stdlib/lib/puppet/parser/functions/validate_integer.rb:137: syntax error, unexpected kEND, expecting $end on node 

@jsjohnst
Copy link

jsjohnst commented Feb 21, 2019

FYI, the lambda issue in validate_integer is still an issue... Are we just cutting support for RHEL<7 and Puppet 3.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants