test lint and spellcheck actions (#64)

* test lint and spellcheck actions

* config spellcheck and lint only changed files

* fix error

* fix linting errors

* update cspell json

* simplify linting to just 3.10 for now

* update job id

* make config use explicit

* update config:
This commit is contained in:
derek-hirotsu
2023-10-04 16:16:00 -07:00
committed by GitHub
parent 9bbf209ea9
commit f9bc0bd616
3 changed files with 42 additions and 4 deletions

31
.github/workflows/linting.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Linting
on:
pull_request:
branches: [ "main" ]
jobs:
# For more info see:
# https://github.com/streetsidesoftware/cspell-action
spell_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: streetsidesoftware/cspell-action@v3
exec_pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git diff --name-only -r HEAD^1 HEAD -- '*.py')

4
cspell.json Normal file
View File

@@ -0,0 +1,4 @@
{
"ignorePaths": [".*/"],
"allowCompoundWords": true
}

View File

@@ -1,4 +1,5 @@
"""Kombustor test script"""
# cSpell:ignore kombustor
from argparse import ArgumentParser
from subprocess import Popen
import json
@@ -30,6 +31,7 @@ flags = [
"-logfile_in_app_folder"
]
# cSpell:disable
avail_tests = [
"vkfurrytorus",
"glfurrytorus",
@@ -55,13 +57,14 @@ avail_tests = [
"gltessyspherex32",
"gltessyspherex16",
]
# cSpell:enable
INSTALL_DIR = "C:\Program Files\Geeks3D\MSI Kombustor 4 x64"
INSTALL_DIR = r"C:\Program Files\Geeks3D\MSI Kombustor 4 x64"
EXECUTABLE = "MSI-Kombustor-x64.exe"
parser = ArgumentParser()
parser.add_argument("-t", "--test", dest="test",
help="kombuster test", metavar="test", required=True)
help="kombustor test", metavar="test", required=True)
parser.add_argument("-r", "--resolution", dest="resolution",
help="resolution", metavar="resolution", required=True)
parser.add_argument("-b", "--benchmark", dest="benchmark",
@@ -99,8 +102,8 @@ if args.benchmark == "true":
print(cmd)
print(argstr)
process = Popen([cmd, argstr])
EXIT_CODE = process.wait()
with Popen([cmd, argstr]) as process:
EXIT_CODE = process.wait()
SCORE = "N/A"
# need to find "score => 1212 points"