leanprover / leanprover/lean4

lake: command-specific options should not be accepted globally

Open
#13,184 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

lake shake has several options (--keep-implied, --keep-prefix, --force, --fix, --trace, etc.) that are parsed in the global lakeLongOption function but only meaningful for lake shake. This means e.g. lake build --fix is silently accepted and ignored.

The upcoming lake profile command (#12545) adds more of these: --rate, --output, --raw. The --output case is particularly unfortunate since it's a plausible flag for other commands.

It would be better to scope command-specific options so they're only accepted for the relevant command, and produce an error otherwise.

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 with the global lakeLongOption function and trace how options are parsed for lake shake and the upcoming lake profile command. Verify that command-specific flags are rejected by unrelated commands, including plausible flags such as --output, and that the relevant commands still accept their own options.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.