Skip to content

Commit

Permalink
pre-commit lint
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Nov 21, 2023
1 parent 6ec242f commit acf4454
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
exclude: ".projen*|.git*"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks
- repo: local
hooks:
- id: eslint
name: eslint
entry: bash -c "npm run lint"
language: node
- id: test
name: test
entry: bash -c "npm run test"
stages: [pre-push]
language: node
1 change: 0 additions & 1 deletion src/execute/lex-pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class LexPipe extends Frame implements IFinish, IPerformer {
break
}
case 'bind': {
break
const next_parser = parser.bind()
this.set(Frame.kOUT, next_parser)
this.level += 1
Expand Down
4 changes: 2 additions & 2 deletions src/execute/lex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Token extends FrameAtom {
return `Token[${this.data.inspect()}]`
}

public isSpace() {
public isSpace () {
return this.data instanceof FrameSpace
}
}
Expand Down Expand Up @@ -57,7 +57,7 @@ export class Lex extends Frame implements ISourced {
const end = this.isEnd(char)
const terminal = Lex.isTerminal(char)
const not_quote = !this.isQuote()
const not_space = char != ' '
const not_space = char !== ' '

if (end && terminal && not_space) { // ends token on a terminal
return this.finish(argument, true)
Expand Down
4 changes: 2 additions & 2 deletions src/execute/parse-pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export class ParsePipe extends FrameArray implements IFinish {
return this
}

public bind(_Factory: any = undefined): Frame {
public bind (_Factory: any = undefined): Frame {
return this.push(FrameBind)
}

public unbind(): boolean {
public unbind (): boolean {
if (this.Factory === FrameBind) {
this.pop(FrameBind)
return true
Expand Down
4 changes: 2 additions & 2 deletions src/frames/frame-array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export class FrameArray extends FrameList {
const array = this.array_eval(contexts)
return new FrameArray(array)
}

public get (key: string, origin: MetaFrame = this): Frame {
if (!isNaN(Number(key))) {
return this.at(Number(key));
return this.at(Number(key))
}
return super.get(key, origin)
}
Expand Down
2 changes: 1 addition & 1 deletion test/frames/frame-expr-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('FrameExpr', () => {

expect(result).to.equal(context)
})

it('applies FrameName to FrameArray to extract elements that index', () => {
const js_string_2 = ', MAML!'
const frame_string_2 = new FrameString(js_string_2)
Expand Down

0 comments on commit acf4454

Please sign in to comment.