tldr-pages / tldr-lint

A linting tool to validate tldr pages
https://www.npmjs.com/package/tldr-lint
MIT License
35 stars 20 forks source link

New linter error if you reference a non-existing TLDR-page #277

Closed sebastiaanspeck closed 3 months ago

sebastiaanspeck commented 8 months ago

I have already opened a issue for the TLDR main repo: https://github.com/tldr-pages/tldr/issues/11068, but I can imagine we maybe want to have a check in the linter itself if the user isn't introducing a reference to a non-existing TLDR-page.

Running tldr cgroups -p linux results in:

- Show the tldr page for `cgclassify`:
    tldr cgclassify

But running tldr cgclassify -p linux results in:

This page doesn't exist yet!
Submit new pages here: https://github.com/tldr-pages/tldr

Right now this is the status per language:


11 missing TLDR Pages in missing-tldr.md.
188 missing TLDR Pages in missing-tldr-hi.md.
198 missing TLDR Pages in missing-tldr-ne.md.
186 missing TLDR Pages in missing-tldr-ta.md.
0 missing TLDR Pages in missing-tldr-cs.md.
197 missing TLDR Pages in missing-tldr-bs.md.
198 missing TLDR Pages in missing-tldr-pt_PT.md.
199 missing TLDR Pages in missing-tldr-uk.md.
190 missing TLDR Pages in missing-tldr-sv.md.
198 missing TLDR Pages in missing-tldr-th.md.
166 missing TLDR Pages in missing-tldr-es.md.
185 missing TLDR Pages in missing-tldr-tr.md.
160 missing TLDR Pages in missing-tldr-de.md.
0 missing TLDR Pages in missing-tldr-uz.md.
161 missing TLDR Pages in missing-tldr-fr.md.
0 missing TLDR Pages in missing-tldr-fa.md.
180 missing TLDR Pages in missing-tldr-pl.md.
183 missing TLDR Pages in missing-tldr-nl.md.
199 missing TLDR Pages in missing-tldr-da.md.
187 missing TLDR Pages in missing-tldr-ja.md.
0 missing TLDR Pages in missing-tldr-ro.md.
177 missing TLDR Pages in missing-tldr-id.md.
145 missing TLDR Pages in missing-tldr-pt_BR.md.
163 missing TLDR Pages in missing-tldr-ko.md.
200 missing TLDR Pages in missing-tldr-lo.md.
183 missing TLDR Pages in missing-tldr-ru.md.
153 missing TLDR Pages in missing-tldr-it.md.
182 missing TLDR Pages in missing-tldr-zh_TW.md.
0 missing TLDR Pages in missing-tldr-sh.md.
196 missing TLDR Pages in missing-tldr-ca.md.
198 missing TLDR Pages in missing-tldr-ar.md.
0 missing TLDR Pages in missing-tldr-sr.md.
196 missing TLDR Pages in missing-tldr-ml.md.
148 missing TLDR Pages in missing-tldr-zh.md.
0 missing TLDR Pages in missing-tldr-bn.md.
195 missing TLDR Pages in missing-tldr-no.md.

As you can see, there are only 7 languages that don't have any non-existing links.

owenvoke commented 8 months ago

So, this would (like your script) be checking for uses of tldr [command] within backticks?

My only thought is if you were working on a suite of pages, they might reference each other and every PR would be failing until they are all in.

Overall, this sounds like a good idea though.

sebastiaanspeck commented 8 months ago

Exactly! My opinion is that you fix a missing reference when touching a page. I don't think anyone would like to update more than 100 pages at once, so fixing this will be an ongoing process.

gutjuri commented 3 months ago

IMO this should be done in another step of the CI, as this concerns not the syntax but the semantics of the page. However, It may be good to keep this issue upen as a reminder.

kbdharun commented 3 months ago

IMO this should be done in another step of the CI, as this concerns not the syntax but the semantics of the page. However, It may be good to keep this issue open as a reminder.

Yeah, this has been implemented in the tldr-maintenance repo too (so don't know if we need it again here).

owenvoke commented 3 months ago

If it's in the other repo, I think it doesn't make sense to run as part of the linter (otherwise we're just duplicating code). I think it's probably safe to close this, and use the other one to clean up references where necessary. šŸ‘šŸ»