Skip to content
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

RFC: style: number of spaces before | #2580

Closed
mo271 opened this issue Sep 25, 2023 · 3 comments
Closed

RFC: style: number of spaces before | #2580

mo271 opened this issue Sep 25, 2023 · 3 comments
Labels
RFC Request for comments

Comments

@mo271
Copy link

mo271 commented Sep 25, 2023

Proposal

I propose to make the amount of spaces used before \ consistent. Currently it is a mix of zero or two spaces, with a majority being two spaces. (There is very few places where another number such as 3 or 4 is used, I'll send a pr for that soon)

Other projects such as std and mathlib are doing two spaces.

  • User Experience: How does this feature improve the user experience?

The user does not have to think how many spaces to type, automation tools can make consistent choices.

  • Beneficiaries: Which Lean users and projects benefit most from this feature/change?

I suppose mainly those that write code in core lean, but of course this style, when done here, will probably be imitated by many other projects.

  • Maintainability: Will this change streamline code maintenance or simplify its structure?

Probably it will minimally simplify maintenance.

Community Feedback

Ideas should be discussed on the Lean Zulip prior to submitting a proposal. Summarize all prior discussions and link them here.

Summary: Two spaces is the de-factor convention, so let's go with this.

https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/style.20for.20proofs.20with.20.60.7C.60.2E

Impact

Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.

@mo271 mo271 added the RFC Request for comments label Sep 25, 2023
@nomeata
Copy link
Collaborator

nomeata commented Sep 25, 2023

This is only about definitions defined by | clauses, but not about the match statement, where the clauses continue to be not indented relative to the match, correct?

@mo271
Copy link
Author

mo271 commented Sep 27, 2023

yes, when there is a match the | should have the same indentation. There are a few handful of cases currently in the library where this is not the case, including an odd number of spaces perhaps also worth cleaning up.

@Kha
Copy link
Member

Kha commented Dec 10, 2024

Thanks for the RFC. As we do not have a formal style guide nor a code formatter implementing one nor do we want to create/review pure style changes manually, this RFC is not directly actionable. Thus I am closing it for the time being.

@Kha Kha closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request for comments
Projects
None yet
Development

No branches or pull requests

3 participants