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

[Merged by Bors] - chore(*): only import one file per line #2470

Closed
wants to merge 10 commits into from

Conversation

semorrison
Copy link
Collaborator

@semorrison semorrison commented Apr 20, 2020

This perhaps-unnecessarily-obsessive PR puts every import statement on its own line.

Why?

  1. it's nice to be able to grep for import X
  2. if we enforced this, it would be easier deal with commands after imports, etc. (irrelevant in 3.9)
  3. it means I can remove all unnecessary transitive imports with a script
  4. it's just tidier. :-)

@gebner
Copy link
Member

gebner commented Apr 20, 2020

if we enforced this, it would be easier deal with commands after imports, etc.

This already works in Lean 3.9:

import tactic.localized

open_locale classical

@jcommelin
Copy link
Member

Nevertheless, I'm a fan of this idea.
I don't think I would want the same with open foo bar, but for import I think the advantages outweigh the extra "noise" above the fold.

@semorrison
Copy link
Collaborator Author

Okay, that's hopefully it.

@bryangingechen
Copy link
Collaborator

bryangingechen commented Apr 20, 2020

docs/contribute/style.md shows an example, but it should have an explicit mention of this change.

Good suggestion. I've done this now.

@semorrison semorrison added the awaiting-review The author would like community review of the PR label Apr 21, 2020
@sgouezel
Copy link
Collaborator

You can merge this once the conflicts are fixed.

@jcommelin
Copy link
Member

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Apr 22, 2020
bors bot pushed a commit that referenced this pull request Apr 22, 2020
This perhaps-unnecessarily-obsessive PR puts every import statement on its own line.

Why?

1. it's nice to be able to grep for `import X`
2. ~~if we enforced this, it would be easier deal with commands after imports, etc.~~ (irrelevant in 3.9)
3. it means I can remove all unnecessary transitive imports with a script
4. it's just tidier. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
@bors
Copy link

bors bot commented Apr 22, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(*): only import one file per line [Merged by Bors] - chore(*): only import one file per line Apr 22, 2020
@bors bors bot closed this Apr 22, 2020
@bors bors bot deleted the one_import_per_line branch April 22, 2020 18:31
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
This perhaps-unnecessarily-obsessive PR puts every import statement on its own line.

Why?

1. it's nice to be able to grep for `import X`
2. ~~if we enforced this, it would be easier deal with commands after imports, etc.~~ (irrelevant in 3.9)
3. it means I can remove all unnecessary transitive imports with a script
4. it's just tidier. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
This perhaps-unnecessarily-obsessive PR puts every import statement on its own line.

Why?

1. it's nice to be able to grep for `import X`
2. ~~if we enforced this, it would be easier deal with commands after imports, etc.~~ (irrelevant in 3.9)
3. it means I can remove all unnecessary transitive imports with a script
4. it's just tidier. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
This perhaps-unnecessarily-obsessive PR puts every import statement on its own line.

Why?

1. it's nice to be able to grep for `import X`
2. ~~if we enforced this, it would be easier deal with commands after imports, etc.~~ (irrelevant in 3.9)
3. it means I can remove all unnecessary transitive imports with a script
4. it's just tidier. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants