Commit 6fbb273a authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'cleanup-rubocop-debugging-code' into 'master'

ci: Remove RuboCop debugging code that's not needed anymore

See merge request gitlab-org/gitlab!63860
parents 30078887 766f5fb6
...@@ -211,13 +211,6 @@ update-static-analysis-cache: ...@@ -211,13 +211,6 @@ update-static-analysis-cache:
- .shared:rules:update-cache - .shared:rules:update-cache
stage: prepare stage: prepare
script: script:
- git log -n 1 --pretty=format:%H -- .rubocop.yml
- git log -n 1 --pretty=format:%H -- .rubocop_manual_todo.yml
- git log -n 1 --pretty=format:%H -- .rubocop_todo.yml
- git log -n 1 --pretty=format:%H -- rubocop/rubocop-migrations.yml
- git log -n 1 --pretty=format:%H -- rubocop/rubocop-usage-data.yml
- git log -n 1 --pretty=format:%H -- rubocop/rubocop-code_reuse.yml
- bundle exec scripts/debug-rubocop spec/factories/namespace/aggregation_schedules.rb
- run_timed_command "bundle exec rubocop --parallel" # For the moment we only cache `tmp/rubocop_cache` so we don't need to run all the tasks. - run_timed_command "bundle exec rubocop --parallel" # For the moment we only cache `tmp/rubocop_cache` so we don't need to run all the tasks.
static-analysis: static-analysis:
...@@ -228,13 +221,6 @@ static-analysis: ...@@ -228,13 +221,6 @@ static-analysis:
parallel: 4 parallel: 4
script: script:
- run_timed_command "retry yarn install --frozen-lockfile" - run_timed_command "retry yarn install --frozen-lockfile"
- git log -n 1 --pretty=format:%H -- .rubocop.yml
- git log -n 1 --pretty=format:%H -- .rubocop_manual_todo.yml
- git log -n 1 --pretty=format:%H -- .rubocop_todo.yml
- git log -n 1 --pretty=format:%H -- rubocop/rubocop-migrations.yml
- git log -n 1 --pretty=format:%H -- rubocop/rubocop-usage-data.yml
- git log -n 1 --pretty=format:%H -- rubocop/rubocop-code_reuse.yml
- bundle exec scripts/debug-rubocop spec/factories/namespace/aggregation_schedules.rb
- scripts/static-analysis - scripts/static-analysis
static-analysis as-if-foss: static-analysis as-if-foss:
......
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'rubocop'
file = ARGV[0]
unless file
warn('Error: missing file, please supply one')
abort
end
# Taken from https://github.com/rubocop/rubocop/blob/v0.93.1/lib/rubocop/result_cache.rb#L159-L171
def file_checksum(file, config_store)
digester = Digest::SHA1.new
mode = File.stat(file).mode
puts "mode of #{file} is #{mode}"
puts "signature of #{file} is #{config_store.for_file(file).signature}"
puts "config is:"
puts config_store.for_file(file).to_h
digester.update(
"#{file}#{mode}#{config_store.for_file(file).signature}"
)
digester.file(file)
digester.hexdigest
rescue Errno::ENOENT
# Spurious files that come and go should not cause a crash, at least not
# here.
'_'
end
config_store = RuboCop::ConfigStore.new
checksum = file_checksum(file, config_store)
puts "File checksum for #{file} is #{checksum}"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment