mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
Sets prettier to run on the repo (#91379)
## About The Pull Request Prettier (an auto formatter) is set to only run within the tgui folder currently. This removes that limitation, allowing it to automatically format all supported files in the repo (.js, .html, .yml [etc](https://prettier.io/docs/)) I made a few exceptions for bundled and generated files ## Why It's Good For The Game I'm of the opinion that code should look uniform and am lazy enough to want CTRL-S to format files without having to think beyond that ## Changelog
This commit is contained in:
@@ -2,14 +2,17 @@ import { strict as assert } from "node:assert";
|
||||
import { get_updated_label_set } from "./autoLabel.js";
|
||||
|
||||
const empty_pr = {
|
||||
action: "opened",
|
||||
pull_request: {
|
||||
body: "This PR will have no labels",
|
||||
title: "Pr with no labels",
|
||||
mergeable: true,
|
||||
},
|
||||
action: "opened",
|
||||
pull_request: {
|
||||
body: "This PR will have no labels",
|
||||
title: "Pr with no labels",
|
||||
mergeable: true,
|
||||
},
|
||||
};
|
||||
const empty_label_set = await get_updated_label_set({ github: null, context: { payload: empty_pr } });
|
||||
const empty_label_set = await get_updated_label_set({
|
||||
github: null,
|
||||
context: { payload: empty_pr },
|
||||
});
|
||||
assert.equal(empty_label_set.length, 0, "No labels should be added");
|
||||
|
||||
const cl = `
|
||||
@@ -19,26 +22,38 @@ My Awesome PR
|
||||
add: Adds Awesome Stuff
|
||||
refactor: refactored some code
|
||||
:/cl:
|
||||
`
|
||||
`;
|
||||
const cl_pr = {
|
||||
action: "opened",
|
||||
pull_request: {
|
||||
body: cl,
|
||||
title: "Awesome PR",
|
||||
mergeable: false,
|
||||
},
|
||||
action: "opened",
|
||||
pull_request: {
|
||||
body: cl,
|
||||
title: "Awesome PR",
|
||||
mergeable: false,
|
||||
},
|
||||
};
|
||||
const cl_label_set = await get_updated_label_set({ github: null, context: { payload: cl_pr } });
|
||||
assert.ok(cl_label_set.includes("Merge Conflict"), "Merge Conflict label should be added");
|
||||
const cl_label_set = await get_updated_label_set({
|
||||
github: null,
|
||||
context: { payload: cl_pr },
|
||||
});
|
||||
assert.ok(
|
||||
cl_label_set.includes("Merge Conflict"),
|
||||
"Merge Conflict label should be added",
|
||||
);
|
||||
assert.ok(cl_label_set.includes("Feature"), "Feature label should be added");
|
||||
assert.ok(!cl_label_set.includes("Refactor"), "Refactor label should not be added");
|
||||
assert.ok(
|
||||
!cl_label_set.includes("Refactor"),
|
||||
"Refactor label should not be added",
|
||||
);
|
||||
|
||||
const title_pr = {
|
||||
action: "opened",
|
||||
pull_request: {
|
||||
title: "Logging is important",
|
||||
mergeable: true,
|
||||
},
|
||||
action: "opened",
|
||||
pull_request: {
|
||||
title: "Logging is important",
|
||||
mergeable: true,
|
||||
},
|
||||
};
|
||||
const title_label_set = await get_updated_label_set({ github: null, context: { payload: title_pr } });
|
||||
const title_label_set = await get_updated_label_set({
|
||||
github: null,
|
||||
context: { payload: title_pr },
|
||||
});
|
||||
assert.ok(title_label_set.includes("Logging"), "Logging label should be added");
|
||||
|
||||
Reference in New Issue
Block a user