-
Notifications
You must be signed in to change notification settings - Fork 285
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
refactor: wrap rescue inside begin / end block #584
base: main
Are you sure you want to change the base?
Conversation
@theobarrague can you take a look at the ruvocop violations? |
Hey @bastelfreak I'm not sure (I'm not a Ruby developer) but the rescue block seems to work with Ruby 2.5+ only (changelog).
For the SLES-12, it seems failed installing puppet and not related to my PR |
Hey @bastelfreak , is there anything wrong with that PR ? |
Hey @theobarrague, it looks like there are some rubocop violations still to resolve here. I'm not entirely sure how much I agree with adding support back in for unsupported Ruby versions. However, if the community decide this is ok to move forward then we should at least add rule ignores to the relevant lines. |
@chelnak it's just a style issue ( |
This Rubocop failure seems to be a blocker for our unit tests. Obviously this is not ideal as we need our tests to be running properly if we want to be able monitor our modules. Either we add an exception to make Rubocop ignore the 'begin' lines (not ideal, we are already working on removing exceptions and outdated syntax) or we find an alternative. What do you think, @chelnak? |
@chelnak up 🙂 In my opinion, if you started to migrate old syntax to new syntax, close this PR. Otherwise, if it's acceptable for you to have a few old syntax ( which don't change the behavior ) to support more versions of Puppet, merge ( i can add the rubocop rules ). But in any case, please take a decision so i can continue with / without. |
Hey @theobarrague, sorry for the long delay in replying. I'm looking again at this and the Pull Request needs a rebase. If you can add the "redundant begin" rule exception to the rubocop_todo.yml (file introduced in our Puppet 8 update) alongside a small comment as to why it exists, I think we would be happy to merge this. Also, I know sometimes its not possible but if you are still using Puppet 5, I would recommend updating to newer, supported versions 😄 |
We are using Puppet 5 ( not a choice, not a choice ... ) and we need the latest version of module with safe_directory.
I had to wrap rescue inside begin / end block to make it works.