-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added github workflows for flake8, mypy, and black
- Loading branch information
1 parent
51093e6
commit 01ed30e
Showing
8 changed files
with
299 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Testing unify | ||
|
||
on: push | ||
|
||
jobs: | ||
black: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install deps | ||
uses: knowsuchagency/poetry-install@v1 | ||
env: | ||
POETRY_VIRTUALENVS_CREATE: false | ||
- name: Run black check | ||
run: poetry run black --check . | ||
flake8: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install deps | ||
uses: knowsuchagency/poetry-install@v1 | ||
env: | ||
POETRY_VIRTUALENVS_CREATE: false | ||
- name: Run flake8 check | ||
run: poetry run flake8 --count . | ||
mypy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install deps | ||
uses: knowsuchagency/poetry-install@v1 | ||
env: | ||
POETRY_VIRTUALENVS_CREATE: false | ||
# - name: Run mypy check | ||
#run: poetry run mypy --install-types --non-interactive . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.4.0 | ||
hooks: | ||
- id: check-ast | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
|
||
- repo: https://github.com/asottile/add-trailing-comma | ||
rev: v2.1.0 | ||
hooks: | ||
- id: add-trailing-comma | ||
|
||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v2.1.0 | ||
hooks: | ||
- id: pretty-format-yaml | ||
args: | ||
- --autofix | ||
- --preserve-quotes | ||
- --indent=2 | ||
|
||
- repo: local | ||
hooks: | ||
- id: autoflake | ||
name: autoflake | ||
entry: poetry run autoflake | ||
language: system | ||
types: [python] | ||
args: [--in-place, --remove-all-unused-imports, --remove-duplicate-keys] | ||
|
||
- id: black | ||
name: Format with Black | ||
entry: poetry run black | ||
language: system | ||
types: [python] | ||
|
||
- id: isort | ||
name: isort | ||
entry: poetry run isort | ||
language: system | ||
types: [python] | ||
|
||
- id: flake8 | ||
name: Check with Flake8 | ||
entry: poetry run flake8 | ||
language: system | ||
pass_filenames: false | ||
types: [python] | ||
args: [--count, .] | ||
|
||
#- id: mypy | ||
# name: Validate types with MyPy | ||
# entry: poetry run mypy | ||
# language: system | ||
# types: [python] | ||
# pass_filenames: false | ||
# args: | ||
# - "." |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[tool.poetry] | ||
name = "unify" | ||
version = "0.1.0" | ||
description = "A Python package for interacting with the Unify API" | ||
authors = ["Unify <[email protected]>"] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.7.1" | ||
openai = "1.12.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.black] | ||
line-length = 88 | ||
target-version = ["py37"] | ||
|
||
[tool.flake8] | ||
max-line-length = 88 | ||
extend-ignore = "E203, W503" | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.autoflake] | ||
remove-all-unused-imports = true | ||
ignore-init-module-imports = true | ||
|
||
[tool.poetry.dev-dependencies] | ||
# Add pre-commit as a dev dependency to ensure it is installed in the virtual environment | ||
pre-commit = "^2.15.0" | ||
|
||
[tool.pre-commit] | ||
# Specify the hooks to run | ||
hooks = [ | ||
"check-ast", | ||
"trailing-whitespace", | ||
"end-of-file-fixer", | ||
"add-trailing-comma", | ||
"pretty-format-yaml", | ||
{ id = "autoflake", args = ["--in-place", "--remove-all-unused-imports", "--remove-duplicate-keys"] }, | ||
"black", | ||
"isort", | ||
"flake8", | ||
{ id = "mypy", args = ["."] } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.