From d1aa0ea0ed4c5fa40d5cac748dbcd981c98a9802 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Fri, 8 Mar 2024 15:18:12 +0100 Subject: [PATCH] rubocop --- bin/commit-cache-update.rb | 2 +- bin/lint.rb | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/bin/commit-cache-update.rb b/bin/commit-cache-update.rb index 1cda20b0768e81..c00f8e0f3636c6 100644 --- a/bin/commit-cache-update.rb +++ b/bin/commit-cache-update.rb @@ -1,5 +1,5 @@ require 'jekyll' -require './_plugins/gtn/mod.rb' +require './_plugins/gtn/mod' # Write the commit log Gtn::ModificationTimes.generate_cache diff --git a/bin/lint.rb b/bin/lint.rb index c45a4b78dac940..9920cbf8649b15 100755 --- a/bin/lint.rb +++ b/bin/lint.rb @@ -345,7 +345,7 @@ def self.check_bad_cite(contents) def self.check_bad_icon(contents) find_matching_texts(contents, /{%\s*icon\s+([^%]*)\s*%}/i) .map do |idx, _text, selected| - icon_key = selected[1].strip.split(' ')[0] + icon_key = selected[1].strip.split[0] if jekyll_config['icon-tag'][icon_key].nil? ReviewDogEmitter.error( path: @path, @@ -1079,21 +1079,19 @@ def self.fix_file(path) end test = YAML.safe_load(File.open(test_file)) - test_plain = File.open(test_file).read + test_plain = File.read(test_file) # check that for each test, the outputs is non-empty test.each do |test_job| - if test_job['outputs'].nil? || test_job['outputs'].empty? - if ! test_plain.match(/GTN_RUN_SKIP_REASON/) - results += [ - ReviewDogEmitter.file_error(path: path, - message: 'This workflow test does not test the contents of outputs, ' \ - 'which is now mandatory. Please see [the FAQ on how to add ' \ - 'tests to your workflows](' \ - 'https://training.galaxyproject.org/training-material/faqs/' \ - 'gtn/gtn_workflow_testing.html).', - code: 'GTN:030') - ] - end + if (test_job['outputs'].nil? || test_job['outputs'].empty?) && !test_plain.match(/GTN_RUN_SKIP_REASON/) + results += [ + ReviewDogEmitter.file_error(path: path, + message: 'This workflow test does not test the contents of outputs, ' \ + 'which is now mandatory. Please see [the FAQ on how to add ' \ + 'tests to your workflows](' \ + 'https://training.galaxyproject.org/training-material/faqs/' \ + 'gtn/gtn_workflow_testing.html).', + code: 'GTN:030') + ] end end end