Browse Source

rubocop

pull/88/head
baarkerlounger 3 years ago
parent
commit
92ffab0c3d
  1. 1
      db/migrate/20211112105348_add_incref_field.rb
  2. 7
      lib/tasks/form_definition.rake

1
db/migrate/20211112105348_add_incref_field.rb

@ -5,4 +5,3 @@ class AddIncrefField < ActiveRecord::Migration[6.1]
end
end
end

7
lib/tasks/form_definition.rake

@ -13,8 +13,8 @@ end
namespace :form_definition do
desc "Validate JSON against Generic Form Schema"
task :validate do
puts "#{Rails.root}"
task validate: :environment do
puts Rails.root.to_s
path = "config/forms/schema/generic.json"
file = File.open(path)
@ -31,14 +31,13 @@ namespace :form_definition do
end
directories = ["config/forms", "spec/fixtures/forms"]
# directories = ["config/forms"]
get_all_form_paths(directories).each do |path|
puts path
file = File.open(path)
data = JSON.parse(file.read)
puts JSON::Validator.fully_validate(schema, data, :strict => true)
puts JSON::Validator.fully_validate(schema, data, strict: true)
begin
JSON::Validator.validate!(schema, data)

Loading…
Cancel
Save