amperser / proselint

A linter for prose.
http://proselint.com
BSD 3-Clause "New" or "Revised" License
4.31k stars 177 forks source link

[feature-proposal] never mind #1364

Closed orgua closed 1 month ago

Nytelife26 commented 5 months ago

I would approve switching from JSON to TOML, especially since the standard library for Python 3.11 upwards includes tomllib, which means we're already guaranteed future support. Should we use toml from PyPI for earlier versions?

Nytelife26 commented 4 months ago

I would approve switching from JSON to TOML, especially since the standard library for Python 3.11 upwards includes tomllib, which means we're already guaranteed future support. Should we use toml from PyPI for earlier versions?

As a follow-on to this, I found out that tomli now maintains a backport of tomllib, so they should have the same interface. Additionally, poetry (although we're not planning to keep using it for long) does support Python-dependent versions, which is convenient.

Then, we'll just be able to do this in the code:

import sys

if sys.version_info >= (3, 11):
    import tomllib
else:
    import tomli as tomllib

I suppose the new filename should be .proselint.toml. I'm not sure why we kept it as proselintrc in the first place, honestly, given that it isn't a command file.