Skip to content

Commit

Permalink
Add pre-commit hooks for bandit, black, codespell, and flake8 (openai…
Browse files Browse the repository at this point in the history
…#2270)

* Add pre-commit hooks for bandit, black, codespell, and flake8

* Those pesky - -- characters...

* Merge workflows and remove reduddency

* Resync
  • Loading branch information
cclauss authored Aug 11, 2021
1 parent 8070fb9 commit c706b54
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://pre-commit.com
# This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file.
name: pre-commit
on:
pull_request:
push:
branches: [master]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install pre-commit
- run: pre-commit --version
- run: pre-commit install
- run: pre-commit run --all-files
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/PyCQA/bandit/
rev: 1.7.0
hooks:
- id: bandit
args:
- --recursive
- --skip
- B101,B108,B301,B403,B404,B603
- .
- repo: https://github.com/python/black
rev: 21.7b0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args:
- --ignore-words-list=nd,reacher,thist,ths
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
args:
- --ignore=E203,E402,E712,E722,E731,E741,F401,F403,F405,F524,F841,W503
- --max-complexity=30
- --max-line-length=456
- --show-source
- --statistics

0 comments on commit c706b54

Please sign in to comment.