diff --git a/.github/workflows/lint-scripts/websites-shared-credentials-sort-order.rb b/.github/workflows/lint-scripts/websites-shared-credentials-sort-order.rb deleted file mode 100644 index 39c51dec3..000000000 --- a/.github/workflows/lint-scripts/websites-shared-credentials-sort-order.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'json' - -def process_file(file_path) - shared_websites = JSON.parse File.read(file_path) - shared_websites_sorted = shared_websites.sort do |a, b| - a_string = a["shared"] ? a["shared"].first : (a["from"] ? a["from"].first : "") - b_string = b["shared"] ? b["shared"].first : (b["from"] ? b["from"].first : "") - a_string <=> b_string - end - - File.open(file_path, 'w') do |f| - f.write JSON.pretty_generate(shared_websites_sorted, indent: ' ') + "\n" - end - - unless shared_websites == shared_websites_sorted - STDERR.puts "The JSON in '#{file_path}' isn't sorted!" - return false - end - - true -end - -shared_credentials_were_sorted = process_file "quirks/shared-credentials.json" -shared_credentials_historical_were_sorted = process_file "quirks/shared-credentials-historical.json" -if !shared_credentials_were_sorted or !shared_credentials_historical_were_sorted - exit 1 -end diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3bab5c4d0..0301058f9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -37,7 +37,7 @@ jobs: with: ruby-version: 2.6 - name: Lint Sort Order - run: ruby .github/workflows/lint-scripts/websites-shared-credentials-sort-order.rb + run: diff quirks/shared-credentials.json <(cat quirks/shared-credentials.json | jq --indent 4 'sort_by(.shared // .from)') - name: Lint Duplicates run: ruby .github/workflows/lint-scripts/websites-shared-credentials-duplicates.rb - name: Verify Generated Files