Welcome to mirror list, hosted at ThFree Co, Russian Federation.

check-mod-tidy « _support - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2bce952211c7dac0e2ac69094b8f7bd90dc94254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby

require_relative 'run.rb'

def main
  mod_not_changed!
  run!(%w[go mod tidy])
  mod_not_changed!
end

def mod_not_changed!
  %w[go.mod go.sum].each do |f|
    unless system(*%W[git diff --quiet --exit-code #{f}])
      abort "error: uncommitted changes in #{f}"
    end
  end
end

main