Skip to content

Commit

Permalink
Merge pull request #1966 from laughedelic/fix/no-default-labels-config
Browse files Browse the repository at this point in the history
add noDefaultLabels config flag
  • Loading branch information
hipstersmoothie committed Apr 29, 2021
2 parents db04067 + b9df9a3 commit 7fabf23
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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

0 comments on commit 7fabf23

Please sign in to comment.