leanprover / leanprover/lean4

`set_option maxErrors` does not work

Open
#13,570 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites
Description

set_option maxErrors inside the file has no effect when calling lean on the file, it seems to be silently ignored.

Context

This came up in the context of comparing lean lia tactic to similar proof procedures in other systems.

Steps to Reproduce
cat > maxErrors.lean << 'EOF'
set_option maxErrors 999888 -- no warning or error on this line

#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I

#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I
#check I #check I #check I #check I #check I  #check I #check I #check I #check I #check I

#check I -- :15:7: error: maximum number of errors (100; from option `maxErrors`) reached, exiting
EOF
lean maxErrors.lean # fails
lean -DmaxErrors=999999 maxErrors.lean # works

Expected behavior: the entire file is processed in both calls to lean

Actual behavior: the first lean execution stops after 100 errors

Versions
  • Lean (version 4.30.0-rc2, x86_64-unknown-linux-gnu, commit 3dc1a088b6d2d8eafe25a7cd7ec7b58d731bd7cc, Release)
  • Lean (version 4.31.0-nightly-2026-04-29, x86_64-unknown-linux-gnu, commit 0a6c31520b2ebaa6e71227454b46ebfb4986ae7b, Release)
  • OS is essentially Debian testing, perhaps lagging by a couple of months.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the minimal maxErrors.lean reproduction with both lean maxErrors.lean and lean -DmaxErrors=999999 maxErrors.lean. Trace how the set_option maxErrors 999888 command-line and in-file options are applied, then verify that the entire file is processed when the option is set in the file.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.