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

Sentence reformatter #54

Open
jarrodmillman opened this issue Feb 9, 2021 · 1 comment
Open

Sentence reformatter #54

jarrodmillman opened this issue Feb 9, 2021 · 1 comment
Assignees

Comments

@jarrodmillman
Copy link
Member

jarrodmillman commented Feb 9, 2021

To make it easier to review PRs (we may want certain SPECs to be regularly updated), we should have a sentence formatter to ensure sentences are kept on separate lines from one another. It should be pre-commit hook and to the CI linter (.github/workflows/lint.yml). We will probably need to write our own tool.

Here are some sentence segmenter/reformatter links:

I am not sure how best to do this. My initial thought was to combine a sentence segmenter with a pandoc filter (to work on the pandoc AST):

I suspect it will be easiest to just go with one sentence per line

When I write documents by myself, I tend to use semantic linefeeds (aka ventilated proses):

But I suspect doing that is easier by hand (so the linefeeds happen in a reasonable place). We could just wrap sentences individually. But then we may need to worry about indentation. For example, I believe

1. Support for a given version of Python be dropped **3 years** after its initial release.
2. Support for a given version of other core packages be dropped **2 years** after their initial release.

should be formatted like

1. Support for a given version of Python be dropped **3 years** after
   its initial release.
2. Support for a given version of other core packages be dropped
   **2 years** after their initial release.

And I am sure the examples can be much more complicated. Pandoc may just handle this for us. If not, I suspect using one sentence per line may get complicated. But maybe it is already as complicated as it gets. For example,

1. Support for a given version of Python be dropped **3 years** after
   its initial release. Support for a given version of other core packages
   be dropped **2 years** after their initial release.

would need to be reformatted to

1. Support for a given version of Python be dropped **3 years** after its initial release.
   Support for a given version of other core packages be dropped **2 years** after their initial release.

I tend to write long-sentences, so the one sentence per line can get annoying if your editor doesn't wrap text for you. However, maybe we should encourage folks to avoid long sentences. I would like the SPECs to be clear and easy to understand. Anything that encourages shorter sentences may help.

Additional links I am not sure where to put:

@jarrodmillman
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants