From f56795b5e2eb30c260c8404a7f912c5d8cbc0846 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 2 Feb 2022 15:01:31 +0200 Subject: [PATCH] Add pre-commit --- .github/workflows/add-pr-to-project.yml | 2 +- .pre-commit-config.yaml | 51 +++++++++++++++++++++++++ README.md | 3 -- sandbox.rst | 2 +- test.py | 4 +- 5 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/add-pr-to-project.yml b/.github/workflows/add-pr-to-project.yml index 1486b56..f9344a9 100644 --- a/.github/workflows/add-pr-to-project.yml +++ b/.github/workflows/add-pr-to-project.yml @@ -47,7 +47,7 @@ jobs: } } }' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectNextItem.projectNextItem.id')" - + echo 'ITEM_ID='$item_id >> $GITHUB_ENV - name: Get date diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1371131 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,51 @@ +repos: + - repo: https://github.com/asottile/pyupgrade + rev: v2.31.0 + hooks: + - id: pyupgrade + args: [--py37-plus] + + - repo: https://github.com/psf/black + rev: 22.1.0 + hooks: + - id: black + args: [--target-version=py37] + + - repo: https://github.com/PyCQA/isort + rev: 5.10.1 + hooks: + - id: isort + + - repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + additional_dependencies: [flake8-2020, flake8-implicit-str-concat] + + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.9.0 + hooks: + - id: python-check-blanket-noqa + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-json + - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/sirosen/check-jsonschema + rev: 0.10.2 + hooks: + - id: check-github-workflows + + - repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.20.0 + hooks: + - id: setup-cfg-fmt + +ci: + autoupdate_schedule: quarterly diff --git a/README.md b/README.md index 491bbb2..bf76356 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,3 @@ test It does the forking for you! 👍 [![Build Status](https://travis-ci.org/hugovk/test.png?branch=main)](https://travis-ci.org/hugovk/test) - - - diff --git a/sandbox.rst b/sandbox.rst index 1248c31..80fab28 100644 --- a/sandbox.rst +++ b/sandbox.rst @@ -2,7 +2,7 @@ Normal text ..code-block:: Python import random - + More normal text diff --git a/test.py b/test.py index 1a0ec9e..b8bdc6f 100755 --- a/test.py +++ b/test.py @@ -1,11 +1,11 @@ #!/usr/bin/env python import sys +from tqdm import tqdm + print(123) print(sys.version) -from tqdm import tqdm - for i in tqdm(range(1000)): pass