Skip to content

Commit

Permalink
Force CI to fail for debugging reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Apr 23, 2024
1 parent 0750e9a commit 7871937
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
46 changes: 23 additions & 23 deletions __tests__/resources.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ describe('Resource', () => {
expect(globGlobSyncMock).toHaveBeenCalled()
expect(fsRealpathSyncNativeMock).toHaveBeenCalled()
expect(resource['extViolations']).toEqual([
{ file: '_work/data/Textures/file.wrg', name: '.wrg', line: 0 },
{ file: '_work/data/Textures/_compiled/file.mo', name: '.mo', line: 0 },
{ file: '_work/data/Textures/file.wrg', name: '.wrg', line: 1 },
{ file: '_work/data/Textures/_compiled/file.mo', name: '.mo', line: 1 },
])
expect(resource['nameViolations']).toEqual([
{ file: '_work/data/Textures/_compiled/file-c.tex', name: 'file-c', line: 0 },
{ file: '_work/data/Textures/_compiled/file.fnt', name: 'file', line: 0 },
{ file: '_work/data/Textures/_compiled/file-c.tex', name: 'file-c', line: 1 },
{ file: '_work/data/Textures/_compiled/file.fnt', name: 'file', line: 1 },
])
expect(resource['numFiles']).toBe(8)
})
Expand Down Expand Up @@ -207,40 +207,40 @@ describe('Resource', () => {
expect(resources[5].numFiles).toBe(4)

expect(resources[0].extViolations).toEqual([
{ file: '_work/data/Anims/file.wrg', name: '.wrg', line: 0 },
{ file: '_work/data/Anims/_compiled/file.mo', name: '.mo', line: 0 },
{ file: '_work/data/Anims/file.wrg', name: '.wrg', line: 1 },
{ file: '_work/data/Anims/_compiled/file.mo', name: '.mo', line: 1 },
])
expect(resources[1].extViolations).toEqual([
{ file: '_work/data/Meshes/file.wrg', name: '.wrg', line: 0 },
{ file: '_work/data/Meshes/_compiled/file.mo', name: '.mo', line: 0 },
{ file: '_work/data/Meshes/file.wrg', name: '.wrg', line: 1 },
{ file: '_work/data/Meshes/_compiled/file.mo', name: '.mo', line: 1 },
])
expect(resources[2].extViolations).toEqual([{ file: '_work/data/Presets/file.wrg', name: '.wrg', line: 0 }])
expect(resources[2].extViolations).toEqual([{ file: '_work/data/Presets/file.wrg', name: '.wrg', line: 1 }])
expect(resources[3].extViolations).toEqual([
{ file: '_work/data/Sound/file.wrg', name: '.wrg', line: 0 },
{ file: '_work/data/Sound/SFX/file.mo', name: '.mo', line: 0 },
{ file: '_work/data/Sound/file.wrg', name: '.wrg', line: 1 },
{ file: '_work/data/Sound/SFX/file.mo', name: '.mo', line: 1 },
])
expect(resources[4].extViolations).toEqual([
{ file: '_work/data/Textures/file.wrg', name: '.wrg', line: 0 },
{ file: '_work/data/Textures/_compiled/file.mo', name: '.mo', line: 0 },
{ file: '_work/data/Textures/file.wrg', name: '.wrg', line: 1 },
{ file: '_work/data/Textures/_compiled/file.mo', name: '.mo', line: 1 },
])
expect(resources[5].extViolations).toEqual([{ file: '_work/data/Worlds/file.wrg', name: '.wrg', line: 0 }])
expect(resources[5].extViolations).toEqual([{ file: '_work/data/Worlds/file.wrg', name: '.wrg', line: 1 }])

expect(resources[0].nameViolations).toEqual([])
expect(resources[1].nameViolations).toEqual([
{ file: '_work/data/Meshes/_compiled/file.mrm', name: 'file', line: 0 },
{ file: '_work/data/Meshes/_compiled/file.msh', name: 'file', line: 0 },
{ file: '_work/data/Meshes/_compiled/file.mrm', name: 'file', line: 1 },
{ file: '_work/data/Meshes/_compiled/file.msh', name: 'file', line: 1 },
])
expect(resources[2].nameViolations).toEqual([{ file: '_work/data/Presets/file.zen', name: 'file', line: 0 }])
expect(resources[2].nameViolations).toEqual([{ file: '_work/data/Presets/file.zen', name: 'file', line: 1 }])
expect(resources[3].nameViolations).toEqual([
{ file: '_work/data/Sound/SFX/file.wav', name: 'file', line: 0 },
{ file: '_work/data/Sound/SFX/file.mp3', name: 'file', line: 0 },
{ file: '_work/data/Sound/Speech/file.ogg', name: 'file', line: 0 },
{ file: '_work/data/Sound/SFX/file.wav', name: 'file', line: 1 },
{ file: '_work/data/Sound/SFX/file.mp3', name: 'file', line: 1 },
{ file: '_work/data/Sound/Speech/file.ogg', name: 'file', line: 1 },
])
expect(resources[4].nameViolations).toEqual([
{ file: '_work/data/Textures/_compiled/file-c.tex', name: 'file-c', line: 0 },
{ file: '_work/data/Textures/_compiled/file.fnt', name: 'file', line: 0 },
{ file: '_work/data/Textures/_compiled/file-c.tex', name: 'file-c', line: 1 },
{ file: '_work/data/Textures/_compiled/file.fnt', name: 'file', line: 1 },
])
expect(resources[5].nameViolations).toEqual([{ file: '_work/data/Worlds/file.zen', name: 'file', line: 0 }])
expect(resources[5].nameViolations).toEqual([{ file: '_work/data/Worlds/file.zen', name: 'file', line: 1 }])
})
})
})
4 changes: 2 additions & 2 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ export class Resource {
const allowedExtensions = this.extensions.concat(Resource.ignore)
const extL = ext.toLowerCase()
if (extL && !allowedExtensions.includes(extL)) {
this.extViolations.push({ file: rel, name: ext, line: 0 })
this.extViolations.push({ file: `Rel "${rel}", file: "${fileCase}", workingDir: "${this.workingDir}"`, name: ext, line: 1 })
continue
}

// Check for valid file name, exluding animations (they have generated names)
if (this.name.toLowerCase() !== 'anims') {
const baseNameU = baseName.toUpperCase()
if (!Resource.ignore.includes(extL) && !this.prefix.some((p) => baseNameU.includes(p))) {
this.nameViolations.push({ file: rel, name: baseName, line: 0 })
this.nameViolations.push({ file: rel, name: baseName, line: 1 })
}
}
}
Expand Down

0 comments on commit 7871937

Please sign in to comment.