Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add noDefaultLabels config flag #1966

Merged
merged 4 commits into from Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/pages/docs/configuration/autorc.mdx
Expand Up @@ -244,6 +244,19 @@ To customize your project's labels use the `labels` section in your `.autorc`.

<DefaultLabelRenderer />

#### Overriding default Labels

By default Auto will add the labels you configured to the list of default labels. If you want to create only the labels you configured and ignore defaults, use `noDefaultLabels` option:

```json
{
"noDefaultLabels": true,
"labels": [
// custom labels
]
}
```

#### Label Customization

You can customize everything about a label
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/config.ts
Expand Up @@ -36,8 +36,12 @@ export function normalizeLabel(
* Go through all the labels in a config and make them
* follow the same format.
*/
export function normalizeLabels(config: ConfigObject) {
export function normalizeLabels(config: ConfigObject): ILabelDefinition[] {
if (config.labels) {
if (config.noDefaultLabels) {
return config.labels as ILabelDefinition[];
}

const userLabels: ILabelDefinition[] = config.labels.map(normalizeLabel);
const baseLabels = defaultLabels.filter(
(d) =>
Expand Down