-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deal with combination of floating title and beforeclauses note: https… #822
Conversation
# only move clausebefore notes at the very end of preface | ||
def endofpreface_clausebefore(xmldoc, ins) | ||
xmldoc.xpath("//preface//*[@beforeclauses = 'true']").reverse.each do |x| | ||
textafternote = xmldoc.xpath("//preface//*") & x.xpath("./following::*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
|
||
# only move clausebefore notes at the very end of preface | ||
def endofpreface_clausebefore(xmldoc, ins) | ||
xmldoc.xpath("//preface//*[@beforeclauses = 'true']").reverse.each do |x| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [81/80]
ins = insert_before(xmldoc, "//sections") | ||
xmldoc.xpath("//sections//*[@beforeclauses = 'true']").each do |x| | ||
xmldoc.xpath("//sections//*[@beforeclauses = 'true']").reverse.each do |x| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
expect(xmlpp(strip_guid(ret.to_xml))) | ||
.to be_equivalent_to(xmlpp(output)) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line detected at block body end.
More | ||
|
||
== Scope | ||
INPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INPUT is not aligned with input = <<~INPUT.
.to be_equivalent_to(xmlpp(output)) | ||
|
||
input = <<~INPUT | ||
#{ASCIIDOC_BLANK_HDR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 spaces for indentation in a heredoc.
expect(xmlpp(strip_guid(ret.to_xml))) | ||
.to be_equivalent_to(xmlpp(output)) | ||
|
||
input = <<~INPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected.
@@ -1889,4 +1889,86 @@ | |||
expect(xmlpp(strip_guid(ret.to_xml))) | |||
.to be_equivalent_to(xmlpp(output)) | |||
end | |||
|
|||
it "puts floating title + clausebefore note before scope into sections container" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [86/80]
elsif node.at("./self::*#{ABBRnoSYM}") then :ans | ||
elsif node.at("./self::*#{SYMABBR}") then :sa | ||
elsif node.at("./self::*#{NO_SYMABBR}") then :nsa | ||
elsif node.name == "definitions" # ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid elsif branches without a body.
elsif node.at(".//term") && node.at("./self::*#{SYMnoABBR}") then :tsna | ||
elsif node.at(".//term") && node.at("./self::*#{ABBRnoSYM}") then :tans | ||
elsif node.at(".//term") && node.at("./self::*#{SYMABBR}") then :tsa | ||
elsif node.at(".//term") && node.at("./self::*#{NO_SYMABBR}") then :tnsa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [86/80]
end | ||
elsif node.at(".//term") && node.at("./self::*#{SYMnoABBR}") then :tsna | ||
elsif node.at(".//term") && node.at("./self::*#{ABBRnoSYM}") then :tans | ||
elsif node.at(".//term") && node.at("./self::*#{SYMABBR}") then :tsa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
:term | ||
end | ||
elsif node.at(".//term") && node.at("./self::*#{SYMnoABBR}") then :tsna | ||
elsif node.at(".//term") && node.at("./self::*#{ABBRnoSYM}") then :tans |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [85/80]
unless m[:parent] == :term # don't count Term > Term twice | ||
:term | ||
end | ||
elsif node.at(".//term") && node.at("./self::*#{SYMnoABBR}") then :tsna |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [85/80]
end | ||
end | ||
|
||
def terms_subclause_type_tally(node, m, parent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment Branch Condition size for terms_subclause_type_tally is too high. [<3, 24, 29> 37.76/15]
Cyclomatic complexity for terms_subclause_type_tally is too high. [24/6]
Method has too many lines. [21/10]
Perceived complexity for terms_subclause_type_tally is too high. [25/7]
Method parameter must be at least 3 characters long.
true | ||
end | ||
|
||
def section_names_terms1_cleanup(xml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cyclomatic complexity for section_names_terms1_cleanup is too high. [7/6]
Method has too many lines. [14/10]
IsoDoc::PresentationXMLConvert.new(html_extract_attributes(node)) | ||
IsoDoc::PresentationXMLConvert | ||
.new(html_extract_attributes(node) | ||
.merge(output_formats: ::Metanorma::Standoc::Processor.new.output_formats) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [117/80]
Unnecessary spacing detected.
Space inside parentheses detected.
.to be_equivalent_to xmlpp(output) | ||
end | ||
|
||
it "does not do automated terms & definitions titles if there are extraneous sections" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [91/80]
@@ -873,6 +836,299 @@ | |||
.to be_equivalent_to xmlpp(output) | |||
end | |||
|
|||
it "automates terms & definitions titles if there are no extraneous sections" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
…only one instance of terms boilerplate (as in ISO), and multiple instnces of terms collections or clauses before the terms collection: metanorma/metanorma-iso#1040
…only one instance of terms boilerplate (as in ISO), and multiple instnces of terms collections or clauses before the terms collection: metanorma/metanorma-iso#1040
f = termdef_boilerplate_insert_location(xmldoc) | ||
termdef_boilerplate_insert1(f, xmldoc, isodoc) | ||
else | ||
xmldoc.xpath(self.class::TERM_CLAUSE).each do |f| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shadowing outer local variable - f.
expect_any_instance_of(Metanorma::Standoc::Converter) | ||
.to receive(:termdef_boilerplate_insert) | ||
.and_wrap_original do |method, a, b| | ||
method.call(a, b, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 (not -2) spaces for indentation.
|
||
# ISO behaviour of single Terms boilerplate | ||
def mock_termdef_boilerplate_insert_iso | ||
stub_const("Metanorma::Standoc::Converter::TERM_CLAUSE", "//sections//terms") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [81/80]
|
||
INPUT | ||
output = <<~OUTPUT | ||
#{BLANK_HDR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 spaces for indentation in a heredoc.
.to be_equivalent_to xmlpp(output) | ||
end | ||
|
||
it "places single terms boilerplate at root if there are clauses preceding the terms collection, other than boilerplate" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected.
Line is too long. [127/80]
|
||
INPUT | ||
output = <<~OUTPUT | ||
#{BLANK_HDR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 spaces for indentation in a heredoc.
.to be_equivalent_to xmlpp(output) | ||
end | ||
|
||
it "places single terms boilerplate at root if there are multiple terms collections" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected.
Line is too long. [91/80]
OUTPUT | ||
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) | ||
.to be_equivalent_to xmlpp(output) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end at 1993, 4 is not aligned with it "places single terms boilerplate in expected location for ISO" do at 1953, 2.
|
||
INPUT | ||
output = <<~OUTPUT | ||
#{BLANK_HDR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 spaces for indentation in a heredoc.
…://github.com//issues/815
Metanorma PR checklist