Skip to content

Commit

Permalink
Enhance flake8 code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
vyahello committed Mar 27, 2020
1 parent ca2d15c commit 3bad8c8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
8 changes: 7 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[flake8]
min_python_version = 3.6.0
max_complexity = 10
max-line-length = 120
inline-quotes = double
max-annotations-complexity = 4
max-function-length = 30
statistics = True
count = True
count = True
eradicate-aggressive = True
ignore = I201
2 changes: 1 addition & 1 deletion analyse-source-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ check-flake8() {
:<<DOC
Runs "flake8" code analysers
DOC
--entry-point-box "flake" && ( flake8 ${PACKAGE} )
--entry-point-box "flake" && ( flake8 ${PACKAGE} )
}


Expand Down
9 changes: 8 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ pylint==2.4.4
mypy==0.740
flake8==3.7.9
flake8-comprehensions==3.2.2
flakehell==0.3.3
flake8-typing-imports==1.9.0
flake8-annotations-complexity==0.0.4
flake8-functions==0.0.4
flake8-variables-names==0.0.3
flake8-print==3.1.4
flake8-eradicate==0.3.0
flake8-builtins==1.5.2
flake8-pytest-style==1.0.0
coverage==4.5.4
coveralls==1.8.2
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Package setup entrypoint."""
from typing import IO, Sequence
from setuptools import setup as __compose_package, find_packages as __find_packages
from setuptools import find_packages as __find_packages, setup as __compose_package
from uyaml import (
__version__ as __version,
__author__ as __author,
__doc__ as __short_doc,
__email__ as __email,
__name__ as __name,
__doc__ as __short_doc,
__version__ as __version,
)
from uyaml.file import File

Expand Down
2 changes: 1 addition & 1 deletion uyaml/connection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module contains interfaces to work with connections."""
from abc import abstractmethod
from types import TracebackType
from typing import ContextManager, Optional, Type, Any
from typing import Any, ContextManager, Optional, Type


class Friendly(ContextManager["Friendly"]):
Expand Down
6 changes: 3 additions & 3 deletions uyaml/file.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module contains interfaces to work with general usage files."""
from abc import abstractmethod
from typing import Optional, Type, IO, Tuple, Any, List
from types import TracebackType
from typing import Any, IO, List, Optional, Tuple, Type
from uyaml.connection import Friendly


Expand Down Expand Up @@ -48,8 +48,8 @@ def readlines(self, hint: int = -1) -> List[str]:
class File(Content):
"""Represents text file object."""

def __init__(self, file: str, mode: str = "r") -> None:
self._stream: IO[str] = open(file, mode)
def __init__(self, path: str, mode: str = "r") -> None:
self._stream: IO[str] = open(path, mode)

def write(self, content: str) -> int:
return self._stream.write(content)
Expand Down
2 changes: 1 addition & 1 deletion uyaml/loader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module represents API to load data from specific YAML steam."""
from abc import ABC, abstractmethod
from typing import Dict, Any, IO
from typing import Any, Dict, IO
from yaml import safe_load
from uyaml.file import File, safe_path
from uyaml.type import List
Expand Down

0 comments on commit 3bad8c8

Please sign in to comment.