cloudflare-docs icon indicating copy to clipboard operation
cloudflare-docs copied to clipboard

Clean up all "bash" and "sh" codeblocks

Open Erisa opened this issue 3 years ago • 4 comments

Note: This affects a lot of products, I cleaned up codeblocks across the whole docs. My apologies for the large PR.

There are a great many bash, sh and shell codeblocks across the docs. A lot of them are broken or inconsistent.

The changes were made on the premise that sh or shell codeblocks will only allow selecting text after the initial $ and that bash codeblocks do not.

Summary of the changes made:

  • sh codeblocks with single-line commands that did not have $ at the start have been fixed to do so.
  • sh codeblocks that did not contain any commands or contained multi-line commands have been changed to bash
  • sh codeblocks containing large output blocks or information that the reader may want to copy, have been changed to bash
  • bash codeblocks that contained single-line commands were changed to sh with $ prefix, but only if the output was unlikely to be needed to be copied/highlighted, since this is no longer possible
    • Multi-line commands were left untouched, or changed to bash if they were sh. This is because multi-line commands break on sh codeblocks due to the special behaviour of lines beginning with $.
  • There was a large amount of codeblocks that were JSON but were not tagged as JSON. These were corrected, making the syntax highlighting look better.
    • bash, sh and shell codeblocks representing non-shell languages other than JSON were left untouched because they were a rarity and it is less clear what benefit changing them would bring.
  • bash codeblocks that focus on Windows CMD commands were left untouched because it is unclear whether it was intentional for them to not include $ since CMD generally does not use a $.
  • All other issues/inconsistencies that I saw along the way were resolved.

It's difficult to say exactly how many issues this fixes across the docs, but with any luck it should near-completely resolve the issue of broken or inconsistent shell codeblocks. I went through every single search response for bash, sh and shell codeblocks and checked and fixed all of them.

Preview URL: https://fix-bash-codeblocks.erisa-cloudflare-docs.pages.dev

Erisa avatar Sep 18 '22 04:09 Erisa

The "Assign PCX" action failed with the error Unknown "cloudflare-for-platforms" product! which seems to be unrelated to the changes made. I suppose it was because I modified one of those files and the script isn't aware of that product yet?

Erisa avatar Sep 18 '22 04:09 Erisa

The "Assign PCX" action failed with the error Unknown "cloudflare-for-platforms" product! which seems to be unrelated to the changes made. I suppose it was because I modified one of those files and the script isn't aware of that product yet?

Looks like CF for SaaS and Workers for Platforms have been moved under that new heading - https://github.com/cloudflare/cloudflare-docs/commits/9fa90cb80ea4d42a4d313081c4596e3b6565561e/content/cloudflare-for-platforms/cloudflare-for-saas/security/_index.md

cc @kodster28 @deadlypants1973 Hi Kody & Kate, looks like you both were the reviewers for cloudflare-for-saas and workers respectively - do you know who'll want to be the reviewer for the cloudflare-for-platforms changes going forward?

KianNH avatar Sep 18 '22 18:09 KianNH

Yes

On Sun, Sep 18, 2022, 9:54 PM Kian @.***> wrote:

The "Assign PCX" action failed with the error Unknown "cloudflare-for-platforms" product! which seems to be unrelated to the changes made. I suppose it was because I modified one of those files and the script isn't aware of that product yet?

Looks like CF for SaaS and Workers for Platforms have been moved under that new heading - https://github.com/cloudflare/cloudflare-docs/commits/9fa90cb80ea4d42a4d313081c4596e3b6565561e/content/cloudflare-for-platforms/cloudflare-for-saas/security/_index.md

cc @kodster28 https://github.com/kodster28 @deadlypants1973 https://github.com/deadlypants1973 Hi Kody & Kate, looks like you both were the reviewers for cloudflare-for-saas and workers respectively - do you know who'll want to be the reviewer for the cloudflare-for-platforms changes going forward?

— Reply to this email directly, view it on GitHub https://github.com/cloudflare/cloudflare-docs/pull/5885#issuecomment-1250366403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZNQNRT3GR4JD4RF2S3SVGDV65QOJANCNFSM6AAAAAAQPIUKXY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

paras18559 avatar Sep 18 '22 19:09 paras18559

Thanks for the reminder, @WalshyDev. Fixing this in #5891

kodster28 avatar Sep 19 '22 14:09 kodster28

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret 8aa1c9104462fe62e3455a200d8c784ea64ab3e4 config.toml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

gitguardian[bot] avatar Sep 22 '22 20:09 gitguardian[bot]