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

Detect single line do/end style blocks #931

Open
tas50 opened this issue Jan 18, 2022 · 1 comment
Open

Detect single line do/end style blocks #931

tas50 opened this issue Jan 18, 2022 · 1 comment
Labels
New Cop Proposal A proposal for a new Cookstyle cop Status: Waiting on Contributor A pull request that has unresolved requested actions from the author. Triage: Feature Request Indicates an issue requesting new functionality.

Comments

@tas50
Copy link
Contributor

tas50 commented Jan 18, 2022

execute 'execute-scheduled-karaf-restart' do
  command 'rm -f /tmp/karaf-restart'
  action :run

  notifies :stop, 'service[karaf-deploy-stop]', :immediately
  # notifies cache folders deletion
  $karaf_cache.each do |cache_folder|
    notifies :delete, "directory[#{cache_folder}]", :immediately
  end
  notifies :start, 'service[karaf]', :immediately

  only_if do
    ::File.exist?('/tmp/karaf-restart')
  end
end

The only_if here should just be a single line

@tas50 tas50 added Type: Bug Does not work as expected. Status: Untriaged An issue that has yet to be triaged. labels Jan 18, 2022
@dafyddcrosby
Copy link
Collaborator

Looks like this is handled in RuboCop, and I could see this conflicting with a rubocop config if it was done separately from within Cookstyle. The Chefstyle config has Style/BlockDelimiters disabled, and while I don't have a strong opinion on the Chefstyle config (since it's only Chef-internal code), it'd be downstream code churn if it was enabled in Cookstyle.
Unless there's a use-case I'm missing, this should probably be closed

@dafyddcrosby dafyddcrosby added Status: Waiting on Contributor A pull request that has unresolved requested actions from the author. Triage: Feature Request Indicates an issue requesting new functionality. New Cop Proposal A proposal for a new Cookstyle cop and removed Type: Bug Does not work as expected. Status: Untriaged An issue that has yet to be triaged. labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Cop Proposal A proposal for a new Cookstyle cop Status: Waiting on Contributor A pull request that has unresolved requested actions from the author. Triage: Feature Request Indicates an issue requesting new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants