Skip to content

Commit ac7f111

Browse files
fix: adjust README.md badge indentation (#772)
## PR Checklist - [x] Addresses an existing open issue: fixes #771 - [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 Also expands testing to include `funding`.
1 parent d5cd2a4 commit ac7f111

File tree

2 files changed

+63
-55
lines changed

2 files changed

+63
-55
lines changed

src/steps/writeReadme.test.ts

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const options = {
4242
excludeReleases: undefined,
4343
excludeRenovate: undefined,
4444
excludeTests: undefined,
45-
funding: undefined,
45+
funding: "TestFunding",
4646
owner: "TestOwner",
4747
repository: "test-repository",
4848
skipGitHubApi: false,
@@ -74,18 +74,21 @@ describe("writeReadme", () => {
7474
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
7575
<!-- ALL-CONTRIBUTORS-BADGE:END -->
7676
<!-- prettier-ignore-end -->
77-
</a>
78-
<a href=\\"https://codecov.io/gh/TestOwner/test-repository\\" target=\\"_blank\\">
79-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh/TestOwner/test-repository/branch/main/graph/badge.svg\\"/>
80-
</a>
81-
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
82-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
83-
</a>
84-
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/LICENSE.md\\" target=\\"_blank\\">
85-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license/TestOwner/test-repository?color=21bb42\\">
86-
</a>
87-
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
88-
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
77+
</a>
78+
<a href=\\"https://codecov.io/gh/TestOwner/test-repository\\" target=\\"_blank\\">
79+
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh/TestOwner/test-repository/branch/main/graph/badge.svg\\"/>
80+
</a>
81+
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
82+
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
83+
</a>
84+
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/LICENSE.md\\" target=\\"_blank\\">
85+
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license/TestOwner/test-repository?color=21bb42\\">
86+
</a>
87+
<a href=\\"https://github.com/sponsors/TestFunding\\" target=\\"_blank\\">
88+
<img alt=\\"Sponsor: On GitHub\\" src=\\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\\" />
89+
</a>
90+
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
91+
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
8992
</p>
9093
9194
## Contributors
@@ -131,18 +134,21 @@ describe("writeReadme", () => {
131134
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
132135
<!-- ALL-CONTRIBUTORS-BADGE:END -->
133136
<!-- prettier-ignore-end -->
134-
</a>
135-
<a href=\\"https://codecov.io/gh/TestOwner/test-repository\\" target=\\"_blank\\">
136-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh/TestOwner/test-repository/branch/main/graph/badge.svg\\"/>
137-
</a>
138-
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
139-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
140-
</a>
141-
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/LICENSE.md\\" target=\\"_blank\\">
142-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license/TestOwner/test-repository?color=21bb42\\">
143-
</a>
144-
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
145-
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
137+
</a>
138+
<a href=\\"https://codecov.io/gh/TestOwner/test-repository\\" target=\\"_blank\\">
139+
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh/TestOwner/test-repository/branch/main/graph/badge.svg\\"/>
140+
</a>
141+
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
142+
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
143+
</a>
144+
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/LICENSE.md\\" target=\\"_blank\\">
145+
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license/TestOwner/test-repository?color=21bb42\\">
146+
</a>
147+
<a href=\\"https://github.com/sponsors/TestFunding\\" target=\\"_blank\\">
148+
<img alt=\\"Sponsor: On GitHub\\" src=\\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\\" />
149+
</a>
150+
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
151+
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
146152
</p>
147153
148154
## Contributors
@@ -234,18 +240,21 @@ describe("writeReadme", () => {
234240
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
235241
<!-- ALL-CONTRIBUTORS-BADGE:END -->
236242
<!-- prettier-ignore-end -->
237-
</a>
238-
<a href=\\"https://codecov.io/gh/TestOwner/test-repository\\" target=\\"_blank\\">
239-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh/TestOwner/test-repository/branch/main/graph/badge.svg\\"/>
240-
</a>
241-
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
242-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
243-
</a>
244-
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/LICENSE.md\\" target=\\"_blank\\">
245-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license/TestOwner/test-repository?color=21bb42\\">
246-
</a>
247-
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
248-
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
243+
</a>
244+
<a href=\\"https://codecov.io/gh/TestOwner/test-repository\\" target=\\"_blank\\">
245+
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh/TestOwner/test-repository/branch/main/graph/badge.svg\\"/>
246+
</a>
247+
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
248+
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
249+
</a>
250+
<a href=\\"https://github.com/TestOwner/test-repository/blob/main/LICENSE.md\\" target=\\"_blank\\">
251+
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license/TestOwner/test-repository?color=21bb42\\">
252+
</a>
253+
<a href=\\"https://github.com/sponsors/TestFunding\\" target=\\"_blank\\">
254+
<img alt=\\"Sponsor: On GitHub\\" src=\\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\\" />
255+
</a>
256+
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
257+
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
249258
</p>
250259
251260
<p align=\\"center\\">Test description.</p>

src/steps/writeReadme.ts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,37 +74,36 @@ function findH1Close(contents: string) {
7474
function generateTopContent(options: Options) {
7575
const badgeLines = [
7676
!options.excludeContributors &&
77-
`<a href="#contributors" target="_blank">
77+
` <a href="#contributors" target="_blank">
7878
<!-- prettier-ignore-start -->
7979
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
8080
<img alt="All Contributors: 2" src="https://img.shields.io/badge/all_contributors-17-21bb42.svg" />
8181
<!-- ALL-CONTRIBUTORS-BADGE:END -->
8282
<!-- prettier-ignore-end -->
83-
</a>`,
83+
</a>`,
8484
!options.excludeTests &&
85-
`<a href="https://codecov.io/gh/${options.owner}/${options.repository}" target="_blank">
86-
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg"/>
87-
</a>`,
88-
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
89-
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
90-
</a>`,
91-
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md" target="_blank">
92-
<img alt="License: MIT" src="https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42">
93-
</a>`,
85+
` <a href="https://codecov.io/gh/${options.owner}/${options.repository}" target="_blank">
86+
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg"/>
87+
</a>`,
88+
` <a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
89+
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
90+
</a>`,
91+
` <a href="https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md" target="_blank">
92+
<img alt="License: MIT" src="https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42">
93+
</a>`,
9494
options.funding &&
95-
`
96-
<a href="https://github.com/sponsors/${options.funding}" target="_blank">
97-
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
98-
</a>`,
99-
`<img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />`,
100-
`<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />`,
95+
` <a href="https://github.com/sponsors/${options.funding}" target="_blank">
96+
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
97+
</a>`,
98+
` <img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />`,
99+
` <img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />`,
101100
].filter(Boolean);
102101

103102
return `<h1 align="center">${options.title}</h1>
104103
105104
<p align="center">${options.description}</p>
106105
107106
<p align="center">
108-
${badgeLines.join("\n")}
107+
${badgeLines.join("\n")}
109108
</p>`;
110109
}

0 commit comments

Comments
 (0)