Skip to content

Commit

Permalink
Merge pull request #11858 from keymanapp/feat/developer/11054-improve…
Browse files Browse the repository at this point in the history
…-linter

fix(developer): remove redundant check in LdmlKeyboardCompiler.validate() 🙀
  • Loading branch information
srl295 authored Aug 19, 2024
2 parents 3c14a6e + cb7adbf commit fb3bee1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions developer/src/kmc-ldml/src/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,14 @@ export class LdmlKeyboardCompiler implements KeymanCompiler {
}

/**
* Runs any linter steps
* Runs any linter steps, adding hints to the callbacks as needed
* @internal
* @returns true unless there was a linter failure.
*/
private async lint(source: LDMLKeyboardXMLSourceFile, kmx: KMXPlus.KMXPlusFile): Promise<boolean> {
if (!kmx || !source) {
return false;
}
// run each of the linters
for (const linter of this.buildLinters(source, kmx)) {
if (!await linter.lint()) {
Expand All @@ -325,12 +329,7 @@ export class LdmlKeyboardCompiler implements KeymanCompiler {
}

// Run the linters
if (!await this.lint(source, kmx)) {
return false;
}

// We are valid if we have a keyboard file at this point.
return !!kmx;
return (await this.lint(source, kmx));
}

/**
Expand Down

0 comments on commit fb3bee1

Please sign in to comment.