canonical / starbase

A base repository for packages from the Starcraft team
GNU Lesser General Public License v3.0
9 stars 5 forks source link

docs(readme): add badges #203

Closed lengau closed 1 month ago

lengau commented 7 months ago

Fixes #180


mr-cal commented 7 months 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.

mattculler commented 7 months 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.

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

tigarmo commented 7 months ago

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

lengau commented 7 months ago

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 ?

tigarmo commented 7 months ago

well the real final boss you have to convince here is @sergiusens

mattculler commented 7 months ago

@lengau FWIW I completely agree - hard line breaks are essential for code but don't make sense for docs.

mr-cal commented 7 months ago

+1 on dropping line length linting for docs because the tooling isn't good enough right now:

sergiusens commented 7 months ago

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.

mr-cal commented 3 months ago

Line length issue will be fixed via https://github.com/canonical/starbase/issues/233

mr-cal commented 1 month ago

Is this passing now because of https://github.com/canonical/starbase/pull/221 ?

lengau commented 1 month ago

@mr-cal lol I guess. Nice!