add linting workflows

This commit is contained in:
2023-12-06 20:39:05 +01:00
parent d5daf0de99
commit fa1bb19623
8 changed files with 1824 additions and 0 deletions

61
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,61 @@
name: Lint Code Base
on: [push, pull_request]
jobs:
build:
name: Lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v2
# Setup Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
# Lint Python files
- name: Lint Python
run: |
pip install flake8
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Setup Node.js for JavaScript and TypeScript
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
# Lint JavaScript files
- name: Lint JavaScript
run: |
npm install
npm run lint
# Lint TypeScript files
- name: Lint TypeScript
run: |
npm install
npm run lint
# Setup Rust
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Lint Rust files
- name: Lint Rust
run: |
cd Day*/rust
cargo clippy -- -D warnings