Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lint-action and action-eslint #33318

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Lint

on:
pull_request:
branches:
- master

permissions:
checks: write
contents: write

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

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

- 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.9

- 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this auto-discovers the .flake8 config file (and likewise for javascript)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

flake8: true
flake8_auto_fix: false
flake8_args: ${{ steps.changed-files.outputs.all_changed_files }}
continue_on_error: false

# If this is in the same step as python linting the annotations don't show up
lint-javascript:
name: Lint Javascript
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14

- name: Install Node.js dependencies
run: yarn install --frozen-lockfile

- uses: sibiraj-s/action-eslint@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
annotations: true
32 changes: 0 additions & 32 deletions .github/workflows/linter.yml

This file was deleted.

Loading