Skip to content

Commit

Permalink
fix(format): makes generated labeler.yml as close to prettier formatt…
Browse files Browse the repository at this point in the history
…ing as possible
  • Loading branch information
sverweij committed Dec 13, 2023
1 parent eb5a8cc commit 9f4e1a5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ admin:
documentation:
- changed-files:
- any-glob-to-any-file: README.md

2 changes: 1 addition & 1 deletion dist/labeler-yml/generate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/labeler-yml/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("generate-labeler-yml generates a labeler.yml", () => {
];
const lExpected = `the-a-team:
- changed-files:
- any-glob-to-any-file: knakkerdeknak/**
- any-glob-to-any-file: knakkerdeknak/**
`;
equal(generateLabelerYml(lVirtualCodeOwners, TEAMS, ""), lExpected);
Expand All @@ -110,7 +110,7 @@ describe("generate-labeler-yml generates a labeler.yml", () => {
];
const lExpected = `baarden:
- changed-files:
- any-glob-to-any-file: "**"
- any-glob-to-any-file: "**"
`;
equal(generateLabelerYml(lVirtualCodeOwners, TEAMS, ""), lExpected);
Expand All @@ -137,7 +137,7 @@ describe("generate-labeler-yml generates a labeler.yml", () => {
];
const lExpected = `baarden:
- changed-files:
- any-glob-to-any-file: "*/src/vlaai/*"
- any-glob-to-any-file: "*/src/vlaai/*"
`;
equal(generateLabelerYml(lVirtualCodeOwners, TEAMS, ""), lExpected);
Expand All @@ -164,7 +164,7 @@ describe("generate-labeler-yml generates a labeler.yml", () => {
];
const lExpected = `# some header or other${EOL}baarden:
- changed-files:
- any-glob-to-any-file: src/vlaai/**
- any-glob-to-any-file: src/vlaai/**
`;
equal(
Expand Down
2 changes: 1 addition & 1 deletion src/labeler-yml/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function generateLabelerYml(
const lPatternsForTeam = getPatternsForTeam(pCodeOwners, lTeamName)
.map(
(pPattern) =>
` - any-glob-to-any-file: ${transformForYamlAndMinimatch(
` - any-glob-to-any-file: ${transformForYamlAndMinimatch(
pPattern,
)}${EOL}`,
)
Expand Down

0 comments on commit 9f4e1a5

Please sign in to comment.