-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6076 from dimagi/implement-linter
Add action-eslint and lint-action
- Loading branch information
Showing
1 changed file
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|