Skip to content

Commit

Permalink
pre-commit: Configure and integrate with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed May 21, 2020
1 parent fd52751 commit 801cc6d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/run_pre_commit.yml
@@ -0,0 +1,37 @@
# Copyright (C) 2020 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license

name: Run pre-commit on all files

on:
- pull_request
- push

jobs:
run_pre_commit:
name: Run pre-commit on all files
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v1.1.1
with:
python-version: 3.8

- name: Install pre-commit
run: |-
pip install \
--disable-pip-version-check \
--user \
--no-warn-script-location \
pre-commit
echo "::set-env name=PATH::${HOME}/.local/bin:${PATH}"
- name: Install pre-commit hooks
run: |-
pre-commit install --install-hooks
- name: Run pre-commit on all files
run: |-
pre-commit run --all-files
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,24 @@
# Copyright (C) 2020 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-yaml
- id: check-merge-conflict
- id: end-of-file-fixer
exclude: '^easy_select2/static/easy_select2/vendor/'
- id: trailing-whitespace

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1
hooks:
- id: flake8
args: ['--show-source']
exclude: '^(docs/source/|sampleproject/demoapp/migrations/)'

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort

0 comments on commit 801cc6d

Please sign in to comment.