Repository: JoshuaKGoldberg/create-typescript-app (ts)

Issue:
🐛 Bug: Long YAML uses with `#` comment gets printed as multiline string
### Bug Report Checklist

- [x] I have tried restarting my IDE and the issue persists.
- [x] I have pulled the latest `main` branch of the repository.
- [x] I have [searched for related issues](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aissue) and found none that matched my issue.

### Expected

Running `npx create-typescript-app` in a repo that already has CTA's `.github/actions/transition/action.yml` shouldn't change whitespace if it doesn't change any actual text.

### Actual

https://github.com/JoshuaKGoldberg/zod-tsconfig/pull/19/files#diff-9e82cd68c6c53993b84c1dd2eda284f2f38f4bb4d1948381b8de0ffb9a3e6916R13 shows:

```diff
-      uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5
+      uses: >-
+        stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79
+        # v5
```

### Additional Info

🎁 

Pull request:
fix: normalize yaml outputs to always use -1 lineWidth
## PR Checklist

- [x] Addresses an existing open issue: fixes #2097
- [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken

## Overview

Whatever reason I had for having two different calls to `jsYaml.dump` is, I think, no longer there. This normalizes all YAML printing to go through the standard `formatYaml`. YAML files now always have a blank line between root-level properties.

🎁 

Patch:
diff --git a/.github/ISSUE_TEMPLATE/01-bug.yml b/.github/ISSUE_TEMPLATE/01-bug.yml
index 179e277..1dd53e2 100644
--- a/.github/ISSUE_TEMPLATE/01-bug.yml
+++ b/.github/ISSUE_TEMPLATE/01-bug.yml
@@ -26,8 +26,12 @@ body:
       description: Any additional info you'd like to provide.
       label: Additional Info
     type: textarea
+
 description: Report a bug trying to run the code
+
 labels:
   - "type: bug"
+
 name: 🐛 Bug
+
 title: "🐛 Bug: <short description of the bug>"
diff --git a/.github/ISSUE_TEMPLATE/02-documentation.yml b/.github/ISSUE_TEMPLATE/02-documentation.yml
index 0aa9fb5..7c41c4f 100644
--- a/.github/ISSUE_TEMPLATE/02-documentation.yml
+++ b/.github/ISSUE_TEMPLATE/02-documentation.yml
@@ -18,8 +18,12 @@ body:
       description: Any additional info you'd like to provide.
       label: Additional Info
     type: textarea
+
 description: Report a typo or missing area of documentation
+
 labels:
   - "area: documentation"
+
 name: 📝 Documentation
+
 title: "📝 Documentation: <short description of the request>"
diff --git a/.github/ISSUE_TEMPLATE/03-feature.yml b/.github/ISSUE_TEMPLATE/03-feature.yml
index 437eed5..fbaf1ed 100644
--- a/.github/ISSUE_TEMPLATE/03-feature.yml
+++ b/.github/ISSUE_TEMPLATE/03-feature.yml
@@ -18,8 +18,12 @@ body:
       description: Any additional info you'd like to provide.
       label: Additional Info
     type: textarea
+
 description: Request that a new feature be added or an existing feature improved
+
 labels:
   - "type: feature"
+
 name: 🚀 Feature
+
 title: "🚀 Feature: <short description of the feature>"
diff --git a/.github/ISSUE_TEMPLATE/04-tooling.yml b/.github/ISSUE_TEMPLATE/04-tooling.yml
index a3dd8d9..5069819 100644
--- a/.github/ISSUE_TEMPLATE/04-tooling.yml
+++ b/.github/ISSUE_TEMPLATE/04-tooling.yml
@@ -20,8 +20,12 @@ body:
       description: Any additional info you'd like to provide.
       label: Additional Info
     type: textarea
+
 description: Report a bug or request an enhancement in repository tooling
+
 labels:
   - "area: tooling"
+
 name: 🛠 Tooling
+
 title: "🛠 Tooling: <short description of the change>"
diff --git a/src/blocks/blockCTATransitions.ts b/src/blocks/blockCTATransitions.ts
index ee96e3f..7073a5c 100644
--- a/src/blocks/blockCTATransitions.ts
+++ b/src/blocks/blockCTATransitions.ts
@@ -4,7 +4,7 @@ import { resolveUses } from "./actions/resolveUses.js";
 import { blockPackageJson } from "./blockPackageJson.js";
 import { blockRepositoryBranchRuleset } from "./blockRepositoryBranchRuleset.js";
 import { createSoloWorkflowFile } from "./files/createSoloWorkflowFile.js";
-import { formatYamlAction } from "./files/formatYamlAction.js";
+import { formatYaml } from "./files/formatYaml.js";
 
 export const blockCTATransitions = base.createBlock({
 	about: {
@@ -28,7 +28,7 @@ export const blockCTATransitions = base.createBlock({
 				".github": {
 					actions: {
 						transition: {
-							"action.yml": formatYamlAction({
+							"action.yml": formatYaml({
 								description: "Runs create-typescript-app in transition mode",
 								name: "Transition",
 								runs: {
@@ -65,7 +65,9 @@ export const blockCTATransitions = base.createBlock({
 												issue: "${{ github.event.pull_request.number }}",
 												message: [
 													"🤖 Beep boop! I ran `npx create-typescript-app` and it updated some files.",
+													"",
 													"I went ahead and checked those changes into this PR for you. Please review the latest commit to see if you want to merge it.",
+													"",
 													"Cheers!",
 													" — _The Friendly Bingo Bot_ 💝",
 													"",
diff --git a/src/blocks/blockGitHubActionsCI.ts b/src/blocks/blockGitHubActionsCI.ts
index e4c1bd2..7404f93 100644
--- a/src/blocks/blockGitHubActionsCI.ts
+++ b/src/blocks/blockGitHubActionsCI.ts
@@ -6,7 +6,7 @@ import { blockRemoveFiles } from "./blockRemoveFiles.js";
 import { blockRepositoryBranchRuleset } from "./blockRepositoryBranchRuleset.js";
 import { createMultiWorkflowFile } from "./files/createMultiWorkflowFile.js";
 import { createSoloWorkflowFile } from "./files/createSoloWorkflowFile.js";
-import { formatYamlAction } from "./files/formatYamlAction.js";
+import { formatYaml } from "./files/formatYaml.js";
 
 export const zActionStep = z.intersection(
 	z.object({
@@ -46,7 +46,7 @@ export const blockGitHubActionsCI = base.createBlock({
 				".github": {
 					actions: {
 						prepare: {
-							"action.yml": formatYamlAction({
+							"action.yml": formatYaml({
 								description: "Prepares the repo for a typical CI job",
 								name: "Prepare",
 								runs: {
diff --git a/src/blocks/files/formatYaml.ts b/src/blocks/files/formatYaml.ts
index 21a7784..c22b31f 100644
--- a/src/blocks/files/formatYaml.ts
+++ b/src/blocks/files/formatYaml.ts
@@ -23,5 +23,8 @@ const options: jsYaml.DumpOptions = {
 };
 
 export function formatYaml(value: unknown) {
-	return removeUsesQuotes(jsYaml.dump(value, options));
+	return removeUsesQuotes(jsYaml.dump(value, options)).replaceAll(
+		/\n(\S)/g,
+		"\n\n$1",
+	);
 }
diff --git a/src/blocks/files/formatYamlAction.ts b/src/blocks/files/formatYamlAction.ts
deleted file mode 100644
index d8251d9..0000000
--- a/src/blocks/files/formatYamlAction.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import jsYaml from "js-yaml";
-
-import { removeUsesQuotes } from "./removeUsesQuotes.js";
-
-export function formatYamlAction(value: object) {
-	return removeUsesQuotes(jsYaml.dump(value).replaceAll(/\n(\S)/g, "\n\n$1"));
-}


Test patch:
diff --git a/src/blocks/blockAllContributors.test.ts b/src/blocks/blockAllContributors.test.ts
index a4227ae..22ad353 100644
--- a/src/blocks/blockAllContributors.test.ts
+++ b/src/blocks/blockAllContributors.test.ts
@@ -68,8 +68,10 @@ describe("blockAllContributors", () => {
 			          GITHUB_TOKEN: \${{ secrets.ACCESS_TOKEN }}
 			        uses: JoshuaKGoldberg/all-contributors-auto-action@v0.5.0
 
+
 			name: Contributors
 
+
 			on:
 			  push:
 			    branches:
@@ -187,8 +189,10 @@ describe("blockAllContributors", () => {
 			          GITHUB_TOKEN: \${{ secrets.ACCESS_TOKEN }}
 			        uses: JoshuaKGoldberg/all-contributors-auto-action@v0.5.0
 
+
 			name: Contributors
 
+
 			on:
 			  push:
 			    branches:
@@ -305,8 +309,10 @@ describe("blockAllContributors", () => {
 			          GITHUB_TOKEN: \${{ secrets.ACCESS_TOKEN }}
 			        uses: JoshuaKGoldberg/all-contributors-auto-action@v0.5.0
 
+
 			name: Contributors
 
+
 			on:
 			  push:
 			    branches:
diff --git a/src/blocks/blockCTATransitions.test.ts b/src/blocks/blockCTATransitions.test.ts
index ab0bc55..ed5cf47 100644
--- a/src/blocks/blockCTATransitions.test.ts
+++ b/src/blocks/blockCTATransitions.test.ts
@@ -50,21 +50,15 @@ describe("blockCTATransitions", () => {
 			      uses: mshick/add-pr-comment@v2
 			      with:
 			        issue: \${{ github.event.pull_request.number }}
-			        message: >-
-			          🤖 Beep boop! I ran \`npx create-typescript-app\` and it updated some
-			          files.
+			        message: |-
+			          🤖 Beep boop! I ran \`npx create-typescript-app\` and it updated some files.
 
-			          I went ahead and checked those changes into this PR for you. Please
-			          review the latest commit to see if you want to merge it.
+			          I went ahead and checked those changes into this PR for you. Please review the latest commit to see if you want to merge it.
 
 			          Cheers!
 			           — _The Friendly Bingo Bot_ 💝
 
-			          > ℹ️ These automatic commits keep your repository up-to-date with new
-			          versions of
-			          [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app).
-			          If you want to opt out, delete your
-			          \`.github/workflows/cta-transitions.yml\` file.
+			          > ℹ️ These automatic commits keep your repository up-to-date with new versions of [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). If you want to opt out, delete your \`.github/workflows/cta-transitions.yml\` file.
 			  using: composite
 			",
 			      },
@@ -87,13 +81,16 @@ describe("blockCTATransitions", () => {
 			      - if: steps.check.outcome == 'skipped'
 			        run: echo 'Skipping transition mode because the PR does not appear to be an automated or owner-created update to create-typescript-app.'
 
+
 			name: CTA
 
+
 			on:
 			  pull_request:
 			    branches:
 			      - main
 
+
 			permissions:
 			  pull-requests: write
 			",
diff --git a/src/blocks/blockGitHubActionsCI.test.ts b/src/blocks/blockGitHubActionsCI.test.ts
index b54c734..0f167df 100644
--- a/src/blocks/blockGitHubActionsCI.test.ts
+++ b/src/blocks/blockGitHubActionsCI.test.ts
@@ -49,8 +49,10 @@ describe("blockGitHubActionsCI", () => {
 			    steps:
 			      - uses: github/accessibility-alt-text-bot@v1.4.0
 
+
 			name: Accessibility Alt Text Bot
 
+
 			on:
 			  issue_comment:
 			    types:
@@ -65,6 +67,7 @@ describe("blockGitHubActionsCI", () => {
 			      - edited
 			      - opened
 
+
 			permissions:
 			  issues: write
 			  pull-requests: write
@@ -82,13 +85,16 @@ describe("blockGitHubActionsCI", () => {
 			          echo "Don't worry if the previous step failed."
 			          echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
 
+
 			name: PR Review Requested
 
+
 			on:
 			  pull_request_target:
 			    types:
 			      - review_requested
 
+
 			permissions:
 			  pull-requests: write
 			",
@@ -153,8 +159,10 @@ describe("blockGitHubActionsCI", () => {
 			    steps:
 			      - uses: github/accessibility-alt-text-bot@v1.4.0
 
+
 			name: Accessibility Alt Text Bot
 
+
 			on:
 			  issue_comment:
 			    types:
@@ -169,6 +177,7 @@ describe("blockGitHubActionsCI", () => {
 			      - edited
 			      - opened
 
+
 			permissions:
 			  issues: write
 			  pull-requests: write
@@ -186,13 +195,16 @@ describe("blockGitHubActionsCI", () => {
 			          echo "Don't worry if the previous step failed."
 			          echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
 
+
 			name: PR Review Requested
 
+
 			on:
 			  pull_request_target:
 			    types:
 			      - review_requested
 
+
 			permissions:
 			  pull-requests: write
 			",
@@ -264,8 +276,10 @@ describe("blockGitHubActionsCI", () => {
 			    steps:
 			      - uses: github/accessibility-alt-text-bot@v1.4.0
 
+
 			name: Accessibility Alt Text Bot
 
+
 			on:
 			  issue_comment:
 			    types:
@@ -280,6 +294,7 @@ describe("blockGitHubActionsCI", () => {
 			      - edited
 			      - opened
 
+
 			permissions:
 			  issues: write
 			  pull-requests: write
@@ -298,8 +313,10 @@ describe("blockGitHubActionsCI", () => {
 			        with:
 			          VAR_WITH: 'true'
 
+
 			name: CI
 
+
 			on:
 			  pull_request: ~
 			  push:
@@ -318,13 +335,16 @@ describe("blockGitHubActionsCI", () => {
 			          echo "Don't worry if the previous step failed."
 			          echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
 
+
 			name: PR Review Requested
 
+
 			on:
 			  pull_request_target:
 			    types:
 			      - review_requested
 
+
 			permissions:
 			  pull-requests: write
 			",
diff --git a/src/blocks/blockReleaseIt.test.ts b/src/blocks/blockReleaseIt.test.ts
index 122943a..3f902c7 100644
--- a/src/blocks/blockReleaseIt.test.ts
+++ b/src/blocks/blockReleaseIt.test.ts
@@ -88,13 +88,16 @@ describe("blockReleaseIt", () => {
 
 			              Cheers! 📦🚀
 
+
 			name: Post Release
 
+
 			on:
 			  release:
 			    types:
 			      - published
 
+
 			permissions:
 			  issues: write
 			  pull-requests: write
@@ -102,6 +105,7 @@ describe("blockReleaseIt", () => {
 			        "release.yml": "concurrency:
 			  group: \${{ github.workflow }}
 
+
 			jobs:
 			  release:
 			    runs-on: ubuntu-latest
@@ -117,13 +121,16 @@ describe("blockReleaseIt", () => {
 			          NPM_TOKEN: \${{ secrets.NPM_TOKEN }}
 			        uses: JoshuaKGoldberg/release-it-action@v0.2.2
 
+
 			name: Release
 
+
 			on:
 			  push:
 			    branches:
 			      - main
 
+
 			permissions:
 			  contents: write
 			  id-token: write
@@ -237,13 +244,16 @@ describe("blockReleaseIt", () => {
 
 			              Cheers! 📦🚀
 
+
 			name: Post Release
 
+
 			on:
 			  release:
 			    types:
 			      - published
 
+
 			permissions:
 			  issues: write
 			  pull-requests: write
@@ -251,6 +261,7 @@ describe("blockReleaseIt", () => {
 			        "release.yml": "concurrency:
 			  group: \${{ github.workflow }}
 
+
 			jobs:
 			  release:
 			    runs-on: ubuntu-latest
@@ -269,13 +280,16 @@ describe("blockReleaseIt", () => {
 			          NPM_TOKEN: \${{ secrets.NPM_TOKEN }}
 			        uses: JoshuaKGoldberg/release-it-action@v0.2.2
 
+
 			name: Release
 
+
 			on:
 			  push:
 			    branches:
 			      - main
 
+
 			permissions:
 			  contents: write
 			  id-token: write