mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Black config, pre-commit and GHA
This commit is contained in:
parent
be00a837cc
commit
8b4af69d87
27
.github/workflows/style-checks.yml
vendored
Normal file
27
.github/workflows/style-checks.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: Black # TODO: add isort and flake8 later
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request: {}
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
tags: "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Install dependencies with pip
|
||||||
|
run: |
|
||||||
|
pip install --upgrade pip wheel
|
||||||
|
pip install .[test]
|
||||||
|
|
||||||
|
# - run: isort --check-only .
|
||||||
|
- run: black --check .
|
||||||
|
# - run: flake8
|
40
.pre-commit-config.yaml
Normal file
40
.pre-commit-config.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# See https://pre-commit.com/ for usage and config
|
||||||
|
repos:
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
name: black
|
||||||
|
stages: [commit]
|
||||||
|
language: system
|
||||||
|
entry: black
|
||||||
|
types: [python]
|
||||||
|
|
||||||
|
# - id: isort
|
||||||
|
# name: isort
|
||||||
|
# stages: [commit]
|
||||||
|
# language: system
|
||||||
|
# entry: isort
|
||||||
|
# types: [python]
|
||||||
|
|
||||||
|
# - id: flake8
|
||||||
|
# name: flake8
|
||||||
|
# stages: [commit]
|
||||||
|
# language: system
|
||||||
|
# entry: flake8
|
||||||
|
# types: [python]
|
||||||
|
|
||||||
|
# - id: mypy
|
||||||
|
# name: mypy
|
||||||
|
# stages: [commit]
|
||||||
|
# language: system
|
||||||
|
# entry: mypy
|
||||||
|
# types: [python]
|
||||||
|
# require_serial: true
|
||||||
|
|
||||||
|
# - id: pytest-cov
|
||||||
|
# name: pytest
|
||||||
|
# stages: [commit]
|
||||||
|
# language: system
|
||||||
|
# entry: pytest --cov --cov-fail-under=90
|
||||||
|
# types: [python]
|
||||||
|
# pass_filenames: false
|
@ -98,7 +98,7 @@ dependencies = [
|
|||||||
"dev" = [
|
"dev" = [
|
||||||
"pudb",
|
"pudb",
|
||||||
]
|
]
|
||||||
"test" = ["pytest>6.0.0", "pytest-cov"]
|
"test" = ["pytest>6.0.0", "pytest-cov", "black"]
|
||||||
"xformers" = [
|
"xformers" = [
|
||||||
"xformers~=0.0.19; sys_platform!='darwin'",
|
"xformers~=0.0.19; sys_platform!='darwin'",
|
||||||
"triton; sys_platform=='linux'",
|
"triton; sys_platform=='linux'",
|
||||||
@ -176,5 +176,8 @@ directory = "coverage/html"
|
|||||||
output = "coverage/index.xml"
|
output = "coverage/index.xml"
|
||||||
#=== End: PyTest and Coverage
|
#=== End: PyTest and Coverage
|
||||||
|
|
||||||
[flake8]
|
[tool.flake8]
|
||||||
max-line-length = 120
|
max-line-length = 100
|
||||||
|
|
||||||
|
[tool.black]
|
||||||
|
line-length = 100
|
Loading…
Reference in New Issue
Block a user