Skip to content

Commit 25c033a

Browse files
committed
fix: apply feedback
1 parent 139e578 commit 25c033a

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ go version
5151

5252
## Namespaces
5353

54-
All Coder resources are scoped to namespaces placed at the top level of the `/registry` directory. Any modules or templates must be placed inside a namespace to be accepted as a contribution. For example, all modules created by TheJonkler would be placed under `/registry/thejonkler/modules`, with a subdirectory for each individual module the user has published.
54+
All Coder resources are scoped to namespaces placed at the top level of the `/registry` directory. Any modules or templates must be placed inside a namespace to be accepted as a contribution. For example, all modules created by CoderEmployeeBob would be placed under `/registry/coderemployeebob/modules`, with a subdirectory for each individual module the user has published.
5555

5656
If a namespace is already taken, you will need to create a different, unique namespace, but will still be able to choose any display name. (The display name is shown in the Registry website. More info below.)
5757

@@ -61,7 +61,7 @@ More information about contributor profile README files can be found below.
6161

6262
### Images
6363

64-
Any images needed for either the main namespace directory or a module/template can be placed in a relative `/images` directory at the top of the namespace directory. (e.g., The Jonkler can have a `/registry/thejonkler/images` directory, that can be referenced by the main README file, as well as a README file in `/registry/thejonkler/modules/custom_module/README.md`.) This is to minimize the risk of file name conflicts between different users as they add images to help illustrate parts of their README files.
64+
Any images needed for either the main namespace directory or a module/template can be placed in a relative `/images` directory at the top of the namespace directory. (e.g., CoderEmployeeBob can have a `/registry/coderemployeebob/images` directory, that can be referenced by the main README file, as well as a README file in `/registry/coderemployeebob/modules/custom_module/README.md`.) This is to minimize the risk of file name conflicts between different users as they add images to help illustrate parts of their README files.
6565

6666
## Coder modules
6767

@@ -197,7 +197,7 @@ In addition to the general criteria, all README files must have the following:
197197
- `avatar_url` (optional string) – A relative/absolute URL pointing to your avatar for the Registry site. It is strongly recommended that you commit avatar images to this repo and reference them via a relative URL.
198198
- `linkedin` (optional string) – A URL pointing to your LinkedIn page.
199199
- `support_email` (optional string) – An email for users to reach you at if they need help with a published module/template.
200-
- `status` (optional string union) – If defined, this must be one of `"community"`, `"partner"`, or `"official"`. `"community"` is treated as the default value if not specified, and should be used for the majority of external contributions. `"partner"` is for companies who have a formal business partnership with Coder. `"official"` should be used only by Coder and Coder satellite companies.
200+
- `status` (optional string union) – If defined, this must be one of `"community"`, `"partner"`, or `"official"`. `"community"` is treated as the default value if not specified, and should be used for the majority of external contributions. `"partner"` is for companies who have a formal business partnership with Coder. `"official"` should be used only by Coder.
201201

202202
- The README body (the content that goes directly below the frontmatter) is allowed to be empty, but if it isn't, it must follow all the rules above.
203203

cmd/readmevalidation/contributors.go

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import (
1616
var validContributorStatuses = []string{"official", "partner", "community"}
1717

1818
type contributorProfileFrontmatter struct {
19-
DisplayName string `yaml:"display_name"`
20-
Bio string `yaml:"bio"`
21-
// Script assumes that if value is nil, the Registry site build step will
22-
// backfill the value with the user's GitHub avatar URL
23-
AvatarURL *string `yaml:"avatar"`
24-
LinkedinURL *string `yaml:"linkedin"`
25-
WebsiteURL *string `yaml:"website"`
26-
SupportEmail *string `yaml:"support_email"`
27-
ContributorStatus *string `yaml:"status"`
19+
DisplayName string `yaml:"display_name"`
20+
Bio string `yaml:"bio"`
21+
ContributorStatus string `yaml:"status"`
22+
// Script assumes that if avatar URL is nil, the Registry site build step
23+
// will backfill the value with the user's GitHub avatar URL
24+
AvatarURL *string `yaml:"avatar"`
25+
LinkedinURL *string `yaml:"linkedin"`
26+
WebsiteURL *string `yaml:"website"`
27+
SupportEmail *string `yaml:"support_email"`
2828
}
2929

3030
type contributorProfileReadme struct {
@@ -105,13 +105,9 @@ func validateContributorWebsite(websiteURL *string) error {
105105
return nil
106106
}
107107

108-
func validateContributorStatus(status *string) error {
109-
if status == nil {
110-
return nil
111-
}
112-
113-
if !slices.Contains(validContributorStatuses, *status) {
114-
return fmt.Errorf("contributor status %q is not valid", *status)
108+
func validateContributorStatus(status string) error {
109+
if !slices.Contains(validContributorStatuses, status) {
110+
return fmt.Errorf("contributor status %q is not valid", status)
115111
}
116112

117113
return nil

0 commit comments

Comments
 (0)