Closed lengau closed 1 month ago
Not sure what the correct way is to fix that "line too long" linter failure when the doc line is a URL - I would almost expect the linter to be aware that you can't wrap URLs.
I was fighting that last week on a personal repo.
These badges in craft-providers (here) used to work and outsmarted the sphinx-lint
line-length rules. But that syntax broke on Github in the last month or so and they don't render well anymore.
Github does a bad job rendering RST and I found many comments to the same effect in Github's issue tracker.
I wasn't able to find any way with sphinx-lint
to disable line-length for URLs.
Not sure what the correct way is to fix that "line too long" linter failure when the doc line is a URL - I would almost expect the linter to be aware that you can't wrap URLs.
I was fighting that last week on a personal repo.
These badges in craft-providers (here) used to work and outsmarted the
sphinx-lint
line-length rules. But that syntax broke on Github in the last month or so and they don't render well anymore.Github does a bad job rendering RST and I found many comments to the same effect in Github's issue tracker.
I wasn't able to find any way with
sphinx-lint
to disable line-length for URLs.
Found this issue: https://github.com/pylint-dev/pylint/issues/2178
Seems like sphinx does ignore long lines for URLs by default, but that fails here since the URL isn't at the start of the line.
So either you have to format your badge RST to put the URL on its own line, or modify sphinx's ignore-long-lines
regex to ignore badge lines.
https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html#ignore-long-lines
Here's one possible suggestion for handling the line-length issue (not sure if it'll actually work): put the URLs in a separate "urls.txt" file, .. include
it at the bottom of the README and then pass --ignore urls.txt
to the sphinx-lint call
Honestly I'm tempted to just get rid of the line-too-long
linter for docs files. Static word wrapping is great for code, but I'm not sure it really matters as much with documentation since most text editors do a good job of wrapping the documentation lines anyway. What do you think @mr-cal @mattculler @tigarmo ?
well the real final boss you have to convince here is @sergiusens
@lengau FWIW I completely agree - hard line breaks are essential for code but don't make sense for docs.
+1 on dropping line length linting for docs because the tooling isn't good enough right now:
Personally not a fan, in the sense that the whole point of these simple markup files is that you can read them without processing them and the presentation might require certain structure.
That said, this should be a soft requirement, I do not care for the linters. If we remove it, let's remove it for all, not just docs.
Line length issue will be fixed via https://github.com/canonical/starbase/issues/233
Is this passing now because of https://github.com/canonical/starbase/pull/221 ?
@mr-cal lol I guess. Nice!
Fixes #180
tox
?