Skip to content

Commit

Permalink
Merge pull request #1 from p-l-/add-checks
Browse files Browse the repository at this point in the history
Add linting checks
  • Loading branch information
p-l- authored Dec 31, 2022
2 parents 114b526 + 87d69a6 commit c7311d8
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [p-l-]
55 changes: 55 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This file is part of IVRE.
# Copyright 2011 - 2022 Pierre LALET <pierre@droids-corp.org>
#
# IVRE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# IVRE is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with IVRE. If not, see <http://www.gnu.org/licenses/>.

name: Linting tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
node-version: ['19']

steps:

- name: Git checkout
uses: actions/checkout@v2

- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- run: pip install codespell

- run: git ls-files | grep -vE '(^package-lock\.json|^doc/.*\.png)$' | xargs -r codespell

- run: npm install

- run: ./node_modules/prettier/bin-prettier.js --check main.ts

- run: ./node_modules/eslint/bin/eslint.js main.ts

- run: ./node_modules/typescript/bin/tsc -noEmit -skipLibCheck --target es2022 --moduleResolution node main.ts
5 changes: 4 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ interface IvrePubkey {
}

interface IvreScript {
// @ts-ignore
id: string;
// @ts-ignore
output: string;
// @ts-ignore
"ssl-cert"?: IvreCertificate[];

[structured: string]: JSON;
Expand Down Expand Up @@ -145,7 +148,7 @@ function flag_emoji(country_code: string): string {
const codePoints = country_code
.toUpperCase()
.split("")
.map((char) => 127397 + char.charCodeAt());
.map((char) => 127397 + char.charCodeAt(0));
return String.fromCodePoint(...codePoints);
}
function tag_emoji(tag: IvreTag): string | undefined {
Expand Down

0 comments on commit c7311d8

Please sign in to comment.