Skip to content

Commit ba5aa84

Browse files
committed
docs: Update README generation
- Reword `Team` section to `Contributors` since the list is only partly team members. - Indicate in the contributors list who are a team member of the `golangci` organization - Update styling on the table to ensure equal sized image and name alignment - Always link to the user's GitHub profile instead of external web page
1 parent a41fe44 commit ba5aa84

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

.github/contributors/generate.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const buildContributorInfo = async (contributors: WeightedContributor[]): Promis
4949
fragment UserFragment on User {
5050
login
5151
name
52-
websiteUrl
5352
avatarUrl
5453
}`
5554

@@ -70,21 +69,21 @@ const buildContributorInfo = async (contributors: WeightedContributor[]): Promis
7069
}
7170
}
7271

73-
const buildCoreTeamInfo = async (): Promise<ContributorInfo[]> => {
72+
const getTeamInfo = async (teamName: string): Promise<ContributorInfo[]> => {
7473
const query = `{
7574
organization(login:"golangci"){
76-
team(slug:"core-team"){
75+
team(slug:"${teamName}"){
7776
members {
7877
nodes {
7978
login
8079
name
81-
websiteUrl
8280
avatarUrl
8381
}
8482
}
8583
}
8684
}
8785
}`
86+
8887
const resp = await graphql.graphql(query, {
8988
headers: {
9089
authorization: `token ${process.env.GITHUB_TOKEN}`,
@@ -115,8 +114,10 @@ const main = async () => {
115114
loginToWeight.forEach((weight, login) => weightedContributors.push({ login, weight }))
116115

117116
weightedContributors.sort((a, b) => b.weight - a.weight)
118-
const coreTeamInfo = await buildCoreTeamInfo()
117+
const coreTeamInfo = await getTeamInfo("core-team")
118+
const teamInfo = await getTeamInfo("team")
119119
const contributorsInfo = await buildContributorInfo(weightedContributors)
120+
contributorsInfo.map((c) => (c.isTeamMember = teamInfo.some((ti) => ti.login == c.login)))
120121
const exclude: any = {
121122
golangcidev: true,
122123
CLAassistant: true,

.github/contributors/info.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export type ContributorInfo = {
33
name: string
44
avatarUrl: string
55
websiteUrl: string
6+
isTeamMember: boolean
67
}
78

89
export type DataJSON = {

.github/contributors/rewrite_readme.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ ${rows
4040
`<tr>\n${row
4141
.map(
4242
(c) =>
43-
` <td align="center"><a href="${
44-
c.websiteUrl ? (c.websiteUrl.startsWith("http") ? c.websiteUrl : `https://${c.websiteUrl}`) : `https://github.com/${c.login}`
45-
}?utm_source=golangci-lint-contributors"><img src="${c.avatarUrl}" width="100px;" alt=""/><br /><sub><b>${
46-
c.name ? c.name : `@${c.login}`
47-
}</b></sub></a></td>`
43+
` <td align="center" valign="top"${
44+
contributors.length >= colPerRow ? ` width="14.28%"` : ``
45+
}><a href="${`https://github.com/${c.login}`}"><img src="${c.avatarUrl}" width="100px;" alt=""/>` +
46+
`<br /><sub><b>${c.name ? c.name : `@${c.login}`}</b>${c.isTeamMember ? "🔹" : ""}</sub></a></td>`
4847
)
4948
.join(`\n`)}\n</tr>`
5049
)
@@ -82,12 +81,14 @@ The Core Team has the following responsibilities:
8281
8382
${buildContributorsTable(data.coreTeam)}
8483
85-
### Team
84+
### Contributors
85+
86+
These contributors have helped shape \`golangci-lint\` into what it is today. Team members are marked with a '🔹' next to their names.
8687
8788
${buildContributorsTable(data.contributors.slice(0, visibleCount))}
8889
8990
<details>
90-
<summary>And ${hiddenCount} more our team members</summary>
91+
<summary>And ${hiddenCount} more contributors</summary>
9192
9293
${buildContributorsTable(data.contributors.slice(visibleCount))}
9394

0 commit comments

Comments
 (0)