-
Notifications
You must be signed in to change notification settings - Fork 63
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
Convention for import statement ordering #491
Comments
Alright, after speaking with Egbert, the new proposal is as follows:
Within each category, the statements are sorted alphabetically, and each namespace is separated with an empty line. |
I was just about to write the same:) These seem very sensible conventions to me. |
This PR adds pre-commit hooks to fix/enforce some conventions like automatically formatting the Agda import block insider `<details>` block. - Closes #491 - Add infrastructure for #448 The hooks are written in Python for ease (also for the CI in the future) and are run using [pre-commit](https://pre-commit.com/). The idea is once you have staged all your changes, you can run (which by default also runs `make check`): ```bash make pre-commit ``` It will automatically fix any formatting issues. In principle, we could also add checks for other conventions in the future, like the ones described in CONVENTIONS.md Oh. I also changed CITATION.md as Github encourages to use the .cff extension. - [x] Update the CI to run pre-commit
As an addendum, import statements are sorted by namespaces first, not just alphabetically as a whole. (#497) In practice, this means |
Jonathan and I have been working together to try to define a ruleset for how import statements should be ordered, as he is developing a script to automate the sorting of these (#488 #487 #484).
The import order that we are currently proposing is the following.
open
statements (this seems to be unconventional, but alas there are instances of this in the library)Within these categories, the statements should be sorted alphabetically.
The reasoning is that this will hopefully correlate well with the relevance of each individual import, while still being somewhat intuitive to the user/contributor.
The text was updated successfully, but these errors were encountered: