Skip to content

Commit 5abbaba

Browse files
authored
Merge pull request #3 from codeday/main
Add support for JPEG image file naming convention
2 parents dca8922 + 5699261 commit 5abbaba

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/scripts/validate-pr.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,18 @@ async function run() {
152152
{
153153
name: "Check file naming convention",
154154
test: ({ data }) => {
155-
const normalizedName = data.name.toLowerCase().replace(/ /g, '_');
156-
const expectedImageNamePng = `images/${normalizedName}.png`;
157-
const expectedImageNameJpg = `images/${normalizedName}.jpg`;
155+
const normalisedName = data.name.toLowerCase().replace(/ /g, '_');
156+
const expectedImageNamePng = `images/${normalisedName}.png`;
157+
const expectedImageNameJpg = `images/${normalisedName}.jpg`;
158+
const expectedImageNameJpeg = `images/${normalisedName}.jpeg`;
158159
return (
159160
data.image === expectedImageNamePng ||
160-
data.image === expectedImageNameJpg
161+
data.image === expectedImageNameJpg ||
162+
data.image === expectedImageNameJpeg
161163
);
162164
},
163165
failMsg:
164-
`❌ Image file name in **${file.filename}** should be based on the cow's name. Expected: images/${data.name.toLowerCase().replace(/ /g, '_')}.png or .jpg`
166+
`❌ Image file name in **${file.filename}** should be based on the cow's name. Expected: images/${data.name.toLowerCase().replace(/ /g, '_')}.png or .jpg or .jpeg`
165167
},
166168
{
167169
name: "Check proper indentation",

0 commit comments

Comments
 (0)