Use fixed allowlist for Bake lint targets

This commit is contained in:
Sami Samhuri 2026-02-07 17:46:47 -08:00
parent 878248cef5
commit fb07e8abba
No known key found for this signature in database

View file

@ -8,6 +8,7 @@ PUBLISH_HOST = 'mudge'.freeze
PRODUCTION_PUBLISH_DIR = '/var/www/samhuri.net/public'.freeze
BETA_PUBLISH_DIR = '/var/www/beta.samhuri.net/public'.freeze
WATCHABLE_DIRECTORIES = %w[public posts lib].freeze
LINT_TARGETS = %w[bake.rb bin Gemfile lib spec].freeze
BUILD_TARGETS = %w[debug mudge beta release].freeze
# Generate the site in debug mode (localhost:8000)
@ -154,12 +155,12 @@ end
# Run StandardRB linter
def lint
exec 'bundle exec standardrb'
exec(*standardrb_command)
end
# Auto-fix StandardRB issues
def lint_fix
exec 'bundle exec standardrb --fix'
exec(*standardrb_command('--fix'))
end
private
@ -189,6 +190,10 @@ def watch_paths
WATCHABLE_DIRECTORIES.flat_map { |path| ['-r', path] }
end
def standardrb_command(*extra_args)
["bundle", "exec", "standardrb", *extra_args, *LINT_TARGETS]
end
def run_rsync(local_paths:, publish_dir:, dry_run:, delete:)
command = ['rsync', '-aKv', '-e', 'ssh -4']
command << '--dry-run' if dry_run