From 5725713cbd51be924b1220b48e22368d5cd81e8c Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Thu, 21 Sep 2023 22:20:59 +0300 Subject: [PATCH] chore: set up flake8, isort and black with pre-commit --- .flake8 | 2 ++ .isort.cfg | 2 ++ .pre-commit-config.yaml | 15 +++++++++++++++ README.md | 9 ++++++++- lint.sh | 1 - requirements.txt | 1 + 6 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 .flake8 create mode 100644 .isort.cfg create mode 100644 .pre-commit-config.yaml delete mode 100755 lint.sh diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..ba5543a --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +extend-ignore = E203,E501,F541 diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..f238bf7 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +profile = black diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1dc59ab --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: + - repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + + - repo: https://github.com/ambv/black + rev: 23.3.0 + hooks: + - id: black diff --git a/README.md b/README.md index c85ea7a..728dd33 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,13 @@ # Tiny Tapeout tools -Tools used mostly by the Tiny Tapeout github actions +Tools used mostly by the Tiny Tapeout GitHub Actions + +## Setup + +``` +pip install -r requirements.txt +pre-commit install +``` ## Documentation diff --git a/lint.sh b/lint.sh deleted file mode 100755 index bfb6bcb..0000000 --- a/lint.sh +++ /dev/null @@ -1 +0,0 @@ -flake8 --ignore E203,E123,E501,E221,E401,W605 configure.py project.py tt_tool.py orders.py documentation.py caravel.py git_utils.py diff --git a/requirements.txt b/requirements.txt index bc2cce1..5e7aa14 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,3 +29,4 @@ webencodings==0.5.1 yowasp-runtime==1.22 yowasp-yosys==0.30.0.0.post538 zipp==3.15.0 +pre-commit==3.4.0