From 9e4df82554fda1d2c14d09140e350bb94adfb4a1 Mon Sep 17 00:00:00 2001 From: Al Snow <43523+jasnow@users.noreply.github.com> Date: Tue, 26 May 2026 12:32:20 -0400 Subject: [PATCH 1/4] Change Rakefile to run json checks first then all checks --- Rakefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 7613feaf5d..30138848a1 100644 --- a/Rakefile +++ b/Rakefile @@ -18,5 +18,9 @@ task :sync_github_advisories, [:gem_name] do |_, args| GitHub::GitHubAdvisorySync.sync(gem_name: args[:gem_name]) end +RSpec::Core::RakeTask.new(:schema) do |t| + t.pattern = 'spec/schema_validation_spec.rb' +end + task :lint => ['lint:yaml'] -task :default => :lint +task :default => [:schema, :lint] From 4ab5566fcffbbdb58746035e78feb34a3eff0df9 Mon Sep 17 00:00:00 2001 From: Al Snow <43523+jasnow@users.noreply.github.com> Date: Wed, 27 May 2026 10:49:04 -0400 Subject: [PATCH 2/4] Exclude schema validation spec from GitHub advisories sync --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index 30138848a1..fd457dbd58 100644 --- a/Rakefile +++ b/Rakefile @@ -15,6 +15,7 @@ end desc "Sync GitHub RubyGem Advisories into this project" task :sync_github_advisories, [:gem_name] do |_, args| require_relative "lib/github_advisory_sync" + t.exclude_pattern = "spec/schema_validation_spec.rb' GitHub::GitHubAdvisorySync.sync(gem_name: args[:gem_name]) end From ab7141172d52b353ce4d7870c572c3b51687b091 Mon Sep 17 00:00:00 2001 From: Al Snow <43523+jasnow@users.noreply.github.com> Date: Wed, 27 May 2026 10:52:15 -0400 Subject: [PATCH 3/4] s/"/"/ --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index fd457dbd58..fa804d69d0 100644 --- a/Rakefile +++ b/Rakefile @@ -15,7 +15,7 @@ end desc "Sync GitHub RubyGem Advisories into this project" task :sync_github_advisories, [:gem_name] do |_, args| require_relative "lib/github_advisory_sync" - t.exclude_pattern = "spec/schema_validation_spec.rb' + t.exclude_pattern = "spec/schema_validation_spec.rb" GitHub::GitHubAdvisorySync.sync(gem_name: args[:gem_name]) end From e14959901122c3f7c170b64ac12559caf62c620b Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Wed, 27 May 2026 12:25:34 -0400 Subject: [PATCH 4/4] Restructure lint tasks to avoid overlap between schema and other linting --- Rakefile | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/Rakefile b/Rakefile index fa804d69d0..4b5648a2e6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,27 +1,31 @@ require 'yaml' -namespace :lint do - begin - require 'rspec/core/rake_task' +begin + require 'rspec/core/rake_task' +rescue LoadError + warn "Warning: RSpec is not installed. Please run `gem install rspec` to install RSpec." +end + +if defined?(RSpec::Core::RakeTask) + namespace :lint do + desc "Lint reports (excluding schema validation)" + RSpec::Core::RakeTask.new(:yaml) do |t| + t.exclude_pattern = 'spec/schema_validation_spec.rb' + end - RSpec::Core::RakeTask.new(:yaml) - rescue LoadError => e - task :spec do - abort "Please run `gem install rspec` to install RSpec." + desc "Validate report schema" + RSpec::Core::RakeTask.new(:schema) do |t| + t.pattern = 'spec/schema_validation_spec.rb' end end + + desc "Run all linting tasks" + task :lint => [ 'lint:schema', 'lint:yaml' ] + task :default => [ :lint ] end desc "Sync GitHub RubyGem Advisories into this project" task :sync_github_advisories, [:gem_name] do |_, args| require_relative "lib/github_advisory_sync" - t.exclude_pattern = "spec/schema_validation_spec.rb" GitHub::GitHubAdvisorySync.sync(gem_name: args[:gem_name]) end - -RSpec::Core::RakeTask.new(:schema) do |t| - t.pattern = 'spec/schema_validation_spec.rb' -end - -task :lint => ['lint:yaml'] -task :default => [:schema, :lint]