Skip to content

Linters

Linters #721

Workflow file for this run

name: Linters
on:
workflow_dispatch:
schedule:
- cron: '0 0,5 * * *'
pull_request:
paths-ignore:
- 'docs/**'
push:
branches:
- main
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
flake8:
name: flake8
runs-on: ubuntu-latest
steps:
- name: Eco-CI Init
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: start-measurement
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install flake8
- name: flake8
# Pinned to v3.0.0.
uses: liskin/gh-problem-matcher-wrap@e7b7beaaafa52524748b31a381160759d68d61fb
with:
linters: flake8
run: flake8
- name: Eco-CI Measurement
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: get-measurement
label: 'linters-flake8'
- name: Eco-CI Results
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: display-results
isort:
runs-on: ubuntu-latest
steps:
- name: Eco-CI Init
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: start-measurement
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install isort
- name: isort
# Pinned to v3.0.0.
uses: liskin/gh-problem-matcher-wrap@e7b7beaaafa52524748b31a381160759d68d61fb
with:
linters: isort
run: isort --check --diff django tests scripts
- name: Eco-CI Measurement
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: get-measurement
label: 'linters-isort'
- name: Eco-CI Results
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: display-results
black:
runs-on: ubuntu-latest
steps:
- name: Eco-CI Init
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: start-measurement
- name: Checkout
uses: actions/checkout@v4
- name: black
uses: psf/black@stable
- name: Eco-CI Measurement
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: get-measurement
label: 'linters-black'
- name: Eco-CI Results
uses: green-coding-berlin/eco-ci-energy-estimation@print-cpu-info
with:
task: display-results