2020-10-29 06:24:07 -04:00
|
|
|
/* eslint-disable no-useless-escape */
|
2023-02-20 08:45:22 -05:00
|
|
|
import packageSuggestions from './HumanReadableLogsPackageSuggestions'
|
2020-10-29 06:24:07 -04:00
|
|
|
|
|
|
|
const rules = [
|
2018-11-05 05:06:39 -05:00
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_misplaced_alignment_tab_character',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Misplaced alignment tab character \&/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_extra_alignment_tab_has_been_changed',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Extra alignment tab has been changed to \\cr/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_display_math_should_end_with',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Display math should end with \$\$/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_missing_inserted',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Missing [{$] inserted./,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_reference_undefined',
|
2022-02-10 04:52:17 -05:00
|
|
|
regexToMatch: /Reference.+undefined/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_there_were_undefined_references',
|
2022-02-10 04:52:17 -05:00
|
|
|
regexToMatch: /There were undefined references/,
|
2018-11-05 05:06:39 -05:00
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_citation_on_page_undefined_on_input_line',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Citation .+ on page .+ undefined on input line .+/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_label_multiply_defined_labels',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /(Label .+)? multiply[ -]defined( labels)?/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_float_specifier_changed',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /`!?h' float specifier changed to `!?ht'/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_no_positions_in_optional_float_specifier',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /No positions in optional float specifier/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_undefined_control_sequence',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Undefined control sequence/,
|
2023-02-20 08:45:22 -05:00
|
|
|
contentRegex: /^l\.[0-9]+\s*(\\\S+)/,
|
|
|
|
improvedTitle: (currentTitle, details) => {
|
|
|
|
if (details?.length && packageSuggestions.has(details[0])) {
|
|
|
|
const command = details[0]
|
|
|
|
const suggestion = packageSuggestions.get(command)
|
|
|
|
return `${suggestion.command} is missing.`
|
|
|
|
}
|
|
|
|
return currentTitle
|
|
|
|
},
|
2018-11-05 05:06:39 -05:00
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_file_not_found',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /File .+ not found/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_unknown_graphics_extension',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: Unknown graphics extension: \..+/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_unknown_float_option_h',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: Unknown float option `H'/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_unknown_float_option_q',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: Unknown float option `q'/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_math_allowed_only_in_math_mode',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: \\math.+ allowed only in math mode/,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ruleId: 'hint_mismatched_environment',
|
|
|
|
types: ['environment'],
|
|
|
|
regexToMatch: /Error: `([^']{2,})' expected, found `([^']{2,})'.*/,
|
|
|
|
newMessage: 'Error: environment does not match \\begin{$1} ... \\end{$2}',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ruleId: 'hint_mismatched_brackets',
|
|
|
|
types: ['environment'],
|
|
|
|
regexToMatch: /Error: `([^a-zA-Z0-9])' expected, found `([^a-zA-Z0-9])'.*/,
|
|
|
|
newMessage: "Error: brackets do not match, found '$2' instead of '$1'",
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_can_be_used_only_in_preamble',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: Can be used only in preamble/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_missing_right_inserted',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Missing \\right inserted/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_double_superscript',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Double superscript/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_double_subscript',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Double subscript/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_no_author_given',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /No \\author given/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_environment_undefined',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: Environment .+ undefined/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_somethings_wrong_perhaps_a_missing_item',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: Something's wrong--perhaps a missing \\item/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_misplaced_noalign',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Misplaced \\noalign/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_no_line_here_to_end',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: There's no line here to end/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_verb_ended_by_end_of_line',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /LaTeX Error: \\verb ended by end of line/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_illegal_unit_of_measure_pt_inserted',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Illegal unit of measure (pt inserted)/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_extra_right',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Extra \\right/,
|
|
|
|
},
|
|
|
|
{
|
2022-03-31 07:22:36 -04:00
|
|
|
ruleId: 'hint_missing_begin_document_',
|
2018-11-05 05:06:39 -05:00
|
|
|
regexToMatch: /Missing \\begin{document}/,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ruleId: 'hint_mismatched_environment2',
|
|
|
|
types: ['environment'],
|
|
|
|
cascadesFrom: ['environment'],
|
2022-01-10 05:23:05 -05:00
|
|
|
regexToMatch:
|
|
|
|
/Error: `\\end\{([^\}]+)\}' expected but found `\\end\{([^\}]+)\}'.*/,
|
2018-11-05 05:06:39 -05:00
|
|
|
newMessage: 'Error: environments do not match: \\begin{$1} ... \\end{$2}',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ruleId: 'hint_mismatched_environment3',
|
|
|
|
types: ['environment'],
|
|
|
|
cascadesFrom: ['environment'],
|
2022-01-10 05:23:05 -05:00
|
|
|
regexToMatch:
|
|
|
|
/Warning: No matching \\end found for `\\begin\{([^\}]+)\}'.*/,
|
2018-11-05 05:06:39 -05:00
|
|
|
newMessage: 'Warning: No matching \\end found for \\begin{$1}',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ruleId: 'hint_mismatched_environment4',
|
|
|
|
types: ['environment'],
|
|
|
|
cascadesFrom: ['environment'],
|
2022-01-10 05:23:05 -05:00
|
|
|
regexToMatch:
|
|
|
|
/Error: Found `\\end\{([^\}]+)\}' without corresponding \\begin.*/,
|
2018-11-05 05:06:39 -05:00
|
|
|
newMessage: 'Error: found \\end{$1} without a corresponding \\begin{$1}',
|
2021-04-27 03:52:58 -04:00
|
|
|
},
|
2020-05-19 05:02:56 -04:00
|
|
|
]
|
2020-10-29 06:24:07 -04:00
|
|
|
|
|
|
|
export default rules
|