gravitational / docs

Source code backing goteleport.com/docs
https://goteleport.com/docs
Apache License 2.0
11 stars 13 forks source link

fix include linter #478

Open GavinFrazar opened 3 months ago

GavinFrazar commented 3 months ago

I made a docs PR that moved an include file, but I missed one place where the docs still used the old include file path. That was this PR:

The linter should have caught that mistake, but it didn't. Here's the lint docs CI run for that PR: https://github.com/gravitational/teleport/actions/runs/9570290956/job/26384715831

For some reason, setting "source" on the vfile messages makes it not report an error consistently. I have no idea why. Depending on the surrounding context, it sometimes caught the error or sometimes did not. For example, this is not caught (the token.mdx file doesn't exist):

(!docs/pages/includes/database-access/token.mdx!)

but if I add some text before/after, it is caught:

blah blah

(!docs/pages/includes/database-access/token.mdx!)

blah blah

With this fix, it catches the bad include consistently:

content/16.x/docs/pages/database-access/enroll-aws-databases/redshift-serverless.mdx
  139:1-139:50  error  Wrong import path docs/pages/includes/database-access/token.mdx in file content/16.x/docs/pages/database-access/enroll-aws-databases/redshift-serverless.mdx.  includes

It also caught other bad includes I was not aware of.

This one should be skipped, I think, since it is marked with {/*lint ignore includes*/}:

content/14.x/docs/pages/contributing/documentation/reference.mdx
    450:1-454:4  error    Wrong import path docs/pages/includes/include.mdx in file content/14.x/docs/pages/contributing/documentation/reference.mdx.     

don't know why it's not skipped. I can add escapes to fix it, but it appear to be a page that 404 on our docs website contributing link.

This one needs to be fixed on our v14 docs:

content/14.x/docs/pages/database-access/guides/postgres-self-hosted.mdx
  165:88-166:62  error  Includes only works if they are the only content on the line                                                                 includes

I've opened PRs to fix the v14 and v16 issues:

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 11:08pm