Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add black and isort precommits #30

Merged
merged 2 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pycqa/isort
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unify the indentation here.

rev: 5.10.1
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ target-version = ["py37"]
src_paths = [
"roboswag"
]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
Expand Down
2 changes: 1 addition & 1 deletion roboswag/generate/generate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from pathlib import Path
from typing import Optional, List
from typing import List, Optional

import black
from jinja2 import Template
Expand Down
3 changes: 1 addition & 2 deletions roboswag/generate/models/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from roboswag.generate.models.parameter import Parameter
from roboswag.generate.models.response import Response
from roboswag.generate.models.tag import Tag
from roboswag.generate.models.utils import get_python_type
from roboswag.generate.models.utils import pythonify_name
from roboswag.generate.models.utils import get_python_type, pythonify_name


class APIModel:
Expand Down
2 changes: 1 addition & 1 deletion roboswag/generate/models/endpoint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from itertools import chain
from typing import List, Dict
from typing import Dict, List

from roboswag.generate.models.parameter import Parameter
from roboswag.generate.models.response import Response
Expand Down
1 change: 0 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from invoke import task


ROOT = pathlib.Path(__file__).parent.resolve().as_posix()


Expand Down