Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test Build

on:
workflow_dispatch: # manually

push:
branches-ignore:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Build Angular
run: |
cd editor
npm install
npm run build

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Generate and Validate
run: |
cd editor
bun ci.ts

compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- uses: dtolnay/rust-toolchain@stable

- name: Generate
run: |
cd editor
bun cargo.ts
File renamed without changes.
14 changes: 7 additions & 7 deletions editor/src/app/utils/command-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function doesCommandHaveAnyAttributeInvalid(command: Command): boolean {

export function doesCommandHaveDuplicateName(
command: Command,
otherCommands: Command[] | undefined
otherCommands: Command[] | undefined,
) {
const thisCommandPlatforms = command.platforms ?? [Platform.Any];
const thisCommandVersions = command.versions ?? [Version.Any];
Expand All @@ -63,7 +63,7 @@ export function doesCommandHaveDuplicateName(
intersection(thisCommandPlatforms, platforms ?? [Platform.Any]).length >
0 &&
intersection(thisCommandVersions, versions ?? [Version.Any]).length > 0 &&
!command.attrs?.is_overload
!command.attrs?.is_overload,
);
}

Expand All @@ -81,7 +81,7 @@ export function isCommandParamNameDuplicate(command: Command, name: string) {

export function doesCommandHaveDuplicateParamName(command: Command) {
return commandParams(command).some((param) =>
isCommandParamNameDuplicate(command, param.name)
isCommandParamNameDuplicate(command, param.name),
);
}

Expand Down Expand Up @@ -169,7 +169,7 @@ export function doesCommandDescriptionHaveTrailingPeriod(command: Command) {
}

export function doesCommandDescriptionNotStartWith3rdPersonVerb(
command: Command
command: Command,
) {
return (
!!command.short_desc && !command.short_desc?.split(' ')[0]?.endsWith('s')
Expand Down Expand Up @@ -248,7 +248,7 @@ export function doesCommandHaveInvalidArgumentWithOperator(command: Command) {

export function doesSelfArgumentHaveInvalidType(command: Command) {
return commandParams(command).some(
(p) => p.name === SELF && p.type !== command.class
(p) => p.name === SELF && p.type !== command.class && command.class,
);
}

Expand All @@ -258,7 +258,7 @@ export function doesOutputHaveInvalidSource(command: Command) {

export function doesInputHaveInvalidSource(command: Command) {
return inputParams(command).some(
(p) => isVarSource(p.source) && !command.operator
(p) => isVarSource(p.source) && !command.operator,
);
}

Expand All @@ -284,7 +284,7 @@ export function doesCommandHaveInvalidArguments(command: Command, game: Game) {
}
const count = commandParams(command).reduce(
(m, v) => m + (v.type === PrimitiveType.arguments ? 1 : 0),
0
0,
);
if (count == 0) {
return false;
Expand Down
Loading