Skip to content

Commit

Permalink
Merge pull request #6076 from dimagi/implement-linter
Browse files Browse the repository at this point in the history
Add action-eslint and lint-action
  • Loading branch information
Charl1996 authored Aug 4, 2023
2 parents f67bf07 + 1aca71e commit a89102c
Showing 1 changed file with 36 additions and 19 deletions.
55 changes: 36 additions & 19 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
---
name: Lint Code Base
name: Lint

on:
pull_request:
branches: [ master ]
branches:
- master

permissions:
checks: write
contents: write

jobs:
build:
name: Lint Code Base
lint-python:
name: Lint Python
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout Code
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Lint Code Base
uses: super-linter/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_FLAKE8: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GITIGNORED_FILES: true
LINTER_RULES_PATH: /
- name: Check changed py files
id: changed-files
uses: tj-actions/changed-files@v24
with:
files: |
**/*.py
- name: Set up Python
uses: actions/setup-python@v1
if: ${{ steps.changed-files.outputs.all_changed_files }}
with:
python-version: 3.10

- name: Install Python dependencies
if: ${{ steps.changed-files.outputs.all_changed_files }}
run: pip install flake8

- name: Run flake8 linter
if: ${{ steps.changed-files.outputs.all_changed_files }}
uses: wearerequired/lint-action@v2
with:
flake8: true
flake8_auto_fix: false
flake8_args: ${{ steps.changed-files.outputs.all_changed_files }}
continue_on_error: false

0 comments on commit a89102c

Please sign in to comment.