Skip to content

Commit

Permalink
add style lint
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangYyang committed Jul 22, 2024
1 parent d9f381d commit b531f80
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Style checker

on:
push:
paths:
- "**.py"
- ".github/workflows/lint.yml"
pull_request:
branches: [main]
paths:
- "**.py"
- ".github/workflows/lint.yml"
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest colorama
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./src/ninjar --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 ./src/ninjar --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
20 changes: 20 additions & 0 deletions .github/workflows/ssh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: SSH
on: [workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install build-script dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
pip install flake8 pytest
- name: Start tmate session
uses: mxschmitt/action-tmate@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ dist
!*.py
!*.md
!pyproject.toml
!*.yml

0 comments on commit b531f80

Please sign in to comment.