git_mirror.rb:352:35: W: Lint/UnusedMethodArgument: Unused method argument - parent_project. If it's necessary, use _ or _parent_project as an argument name to indicate that it won't be used. def handle_submodule(submodule, parent_project) ^^^^^^^^^^^^^^ git_mirror.rb:358:7: W: Lint/NonLocalExitFromIterator: Non-local exit from iterator, without return value. next, break, Array#find, Array#any?, etc. is preferred. return unless git_repo ^^^^^^ Signed-off-by: Li Yuanchao lyc163mail@163.com --- lib/git_mirror.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb index 7f265d9..ce1dc9e 100644 --- a/lib/git_mirror.rb +++ b/lib/git_mirror.rb @@ -349,13 +349,13 @@ class MirrorMain end end
- def handle_submodule(submodule, parent_project) + def handle_submodule(submodule) submodule.each_line do |line| next unless line.include?('url = ')
url = line.split(' = ')[1].chomp git_repo = url.split('://')[1] if url.include?('://') - return unless git_repo + break unless git_repo
@git_info[git_repo] = { 'url' => url, 'git_repo' => git_repo, 'is_submodule' => true } fork_stat_init(git_repo)