Run brew style instead of brew cask style. (#89816)

This commit is contained in:
Markus Reiter
2020-09-25 01:18:32 +02:00
committed by GitHub
parent 16708f7e27
commit 129dfb53c0
12 changed files with 35 additions and 20 deletions
+2 -2
View File
@@ -104,8 +104,8 @@ jobs:
id: gems
run: brew install-bundler-gems
- name: Run brew cask style
run: brew cask style
- name: Run brew style ${{ matrix.tap }}
run: brew style ${{ matrix.tap }}
if: always() && steps.gems.outcome == 'success' && !matrix.cask
- name: Run brew cask audit ${{ matrix.cask.token }}
+1 -1
View File
@@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require "utils/github"
require "utils/formatter"
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module ChangedFiles
def self.collect(tap)
commit_range_start = system_command!("git", args: ["rev-parse", "origin/master"]).stdout.chomp
+3 -1
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "forwardable"
module Check
@@ -77,7 +79,7 @@ module Check
end
def self.errors(before, after, cask:)
uninstall_directives = cask.artifacts.select { |a| a.class == Cask::Artifact::Uninstall }.first&.directives || {}
uninstall_directives = cask.artifacts.find { |a| a.class == Cask::Artifact::Uninstall }&.directives || {}
diff = {}
+12 -7
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative "changed_files"
module CiMatrix
@@ -9,7 +11,11 @@ module CiMatrix
changed_files = ChangedFiles.collect(tap)
ruby_files_in_wrong_directory =
changed_files[:modified_ruby_files] - (changed_files[:modified_cask_files] + changed_files[:modified_command_files] + changed_files[:modified_github_actions_files])
changed_files[:modified_ruby_files] - (
changed_files[:modified_cask_files] +
changed_files[:modified_command_files] +
changed_files[:modified_github_actions_files]
)
if ruby_files_in_wrong_directory.any?
ruby_files_in_wrong_directory.each do |path|
@@ -35,17 +41,16 @@ module CiMatrix
audit_args = ["--download", appcast_arg, "--online"]
if changed_files[:added_files].include?(path)
audit_args << "--new-cask"
end
audit_args << "--new-cask" if changed_files[:added_files].include?(path)
{
name: "test (#{cask.token})",
cask: {
name: "test (#{cask.token})",
tap: tap.name,
cask: {
token: cask.token,
path: "./#{path}",
},
audit_args: audit_args,
audit_args: audit_args,
skip_install: labels.include?("ci-skip-install"),
}
end
+2 -1
View File
@@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
require "utils/github"
@@ -13,6 +13,7 @@ tap = Tap.from_path(Dir.pwd)
syntax_job = {
name: "syntax",
tap: tap.name,
}
matrix = [syntax_job]
+1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "json"
require "open-uri"
+1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "json"
require "open-uri"
+1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "open3"
require "pathname"
+5 -7
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# generate_cask_token
#
# todo:
#
# remove Ruby 2.0 dependency and change shebang line
#
# detect Cask files which differ only by the placement of hyphens.
#
# merge entirely into "brew cask create" command
@@ -34,7 +34,7 @@ EXPANDED_SYMBOLS = {
"@" => "at",
}.freeze
CASK_FILE_EXTENSION = ".rb".freeze
CASK_FILE_EXTENSION = ".rb"
# Hardcode App names that cannot be transformed automatically.
# Example: in "x48.app", "x48" is not a version number.
@@ -357,10 +357,8 @@ def warnings
return @warnings if @warnings
@warnings = []
unless APP_EXCEPTION_PATS.rassoc(cask_token)
if /\d/.match?(cask_token)
@warnings.push "WARNING: '#{cask_token}' contains digits. Digits which are version numbers should be removed."
end
if !APP_EXCEPTION_PATS.rassoc(cask_token) && /\d/.match?(cask_token)
@warnings.push "WARNING: '#{cask_token}' contains digits. Digits which are version numbers should be removed."
end
filename = project_root.join("Casks", cask_file_name)
if filename.exist?
+2
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# list_login_items_for_app
#
+3 -1
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# list_running_app_ids
#
@@ -100,7 +102,7 @@ def report_apps
running.add "#{bundle_id.ljust($COLUMNS / 2)}\t#{app_name}"
end
puts "bundle_id".ljust($COLUMNS / 2) + "\tapp_name"
puts "#{"bundle_id".ljust($COLUMNS / 2)}\tapp_name"
puts "-" * $COLUMNS
puts running.to_a.sort.join "\n"
end