Create linters in github action #5
Workflow file for this run
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
name: Black (python) | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
separator: "," | |
skip_initial_fetch: true | |
- name: Setup Python env | |
uses: actions/setup-python@v3 | |
- name: Install black and reorder-python-imports | |
run: pip install black reorder-python-imports | |
- name: Black and Sort changed files | |
run: | | |
black --check reorder-python-imports ${{ steps.changed-files.outputs.all_changed_files }} |