leanprover-community / leanprover-community/physlib

fix defsWithUnderscore linter

Open
#1,147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
749
Forks
189
Avg merge
1d 21h
Merged PRs (30d)
75

Description

.lake\packages\mathlib\Mathlib\Tactic\Linter\Style.lean introduces a new defsWithUnderscore linter,

The most problematic issue is informal_lemma which elaborates to a def, probably need to include @[nolint defsWithUnderscore]

_physlib-suffixed instances are also flagged, the linter identifies _mathlib ones but not physlib

there's also some meta declarations e.g. semiformal_result, Sorryful_attr, Pseudo_attr

the linter exempts _1 and _2 but not _3 and _4 in Physlib.Mathematics.DataStructures.FourTree.Basic

linter turned off for now but should be fixed

Originally posted by @zhikaip in https://github.com/leanprover-community/physlib/issues/1130#issuecomment-4624883033

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 in .lake/packages/mathlib/Mathlib/Tactic/Linter/Style.lean and inspect the disabled defsWithUnderscore linter. Reproduce its handling of informal_lemma, _physlib-suffixed instances, the listed meta declarations, and the _3/_4 declarations in Physlib.Mathematics.DataStructures.FourTree.Basic; done means the linter runs without incorrectly flagging these cases.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.