Skip to content

Commit

Permalink
refactor logging: metanorma/metanorma-iso#1065
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Dec 8, 2023
1 parent 482f9af commit c9a9d39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ Encoding.default_internal = Encoding::UTF_8
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}" }

gemspec
group :development, :test do
gem "rspec"
end

if File.exist? "Gemfile.devel"
eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
end

gemspec
5 changes: 1 addition & 4 deletions lib/metanorma/modspec/validate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ module Metanorma
class Requirements
class Modspec < Default
def validate(reqt, log)
@fatalerrors = []
@log ||= log
@ids ||= reqt_links(reqt.document)
reqt_cycles_validate
reqt_link_validate(reqt)
@fatalerrors
end

def nested_reqt?(reqt)
Expand Down Expand Up @@ -130,8 +128,7 @@ def reqt_links1_label(reqt, hash, struct)

if hash[:label][struct[:label]]
msg = "Modspec identifier #{struct[:label]} is used more than once"
@log.add("Requirements", reqt, msg)
@fatalerrors << msg
@log.add("Requirements", reqt, msg, severity: 0)
end
hash[:label][struct[:label]] = reqt["id"]
hash
Expand Down

0 comments on commit c9a9d39

Please sign in to comment.