From 0fe9d693dc1456e1a032d6ff2301a7c19c705b4a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 23 Aug 2023 18:36:48 +0100 Subject: [PATCH] Update pre-commit hook to use cookstyle --- hooks/pre-commit | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index 60d665932..a55ac2a93 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -15,11 +15,7 @@ if IO.popen(["git", "ls-files", "--unmerged"]).read.empty? file =~ /\.rb$/ || (file !~ /\.erb$/ && %x(file --brief --mime-type #{file}) == "text/x-ruby\n") end - ok &&= system("bundle", "exec", "rubocop", *ruby_files) unless ruby_files.empty? - - cookbooks = files.grep(%r{(cookbooks/[^/]+)/}) { Regexp.last_match(1) }.uniq - - ok &&= system("bundle", "exec", "foodcritic", *cookbooks) unless cookbooks.empty? + ok &&= system("bundle", "exec", "cookstyle", *ruby_files) unless ruby_files.empty? system("git", "stash", "pop", "--quiet") if need_stash else -- 2.45.1