Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Nov 13, 2024
1 parent 3691ba7 commit bbf4815
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/customization/address/factories.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from fake import ModelFactory, SubFactory, post_save, pre_save
from override_default_data import FACTORY as OVERRIDE_DEFAULT_DATA_FACTORY

from address.models import Address, Person
from fake_address import FACTORY as ADDRESS_FACTORY
from override_default_data import FACTORY as OVERRIDE_DEFAULT_DATA_FACTORY

__author__ = "Artur Barseghyan <artur.barseghyan@gmail.com>"
__copyright__ = "2023-2024 Artur Barseghyan"
Expand Down
2 changes: 1 addition & 1 deletion examples/customization/band/factories.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from band.models import Band
from fake import ModelFactory

from band.models import Band
from fake_band import FACTORY

__author__ = "Artur Barseghyan <artur.barseghyan@gmail.com>"
Expand Down
3 changes: 2 additions & 1 deletion examples/customization/band/tests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import unittest

from fake import FILE_REGISTRY

from band.factories import BandFactory
from band.models import Band
from fake import FILE_REGISTRY

__author__ = "Artur Barseghyan <artur.barseghyan@gmail.com>"
__copyright__ = "2023-2024 Artur Barseghyan"
Expand Down
1 change: 1 addition & 0 deletions examples/customization/custom_data_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from fake import CLI

from override_default_data import FAKER


Expand Down
3 changes: 2 additions & 1 deletion examples/hypothesis/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from decimal import Decimal

from fake import FAKER, FILE_REGISTRY, StringValue, slugify
from hypothesis import Verbosity, given, settings, strategies as st
from hypothesis import Verbosity, given, settings
from hypothesis import strategies as st

__author__ = "Artur Barseghyan <artur.barseghyan@gmail.com>"
__copyright__ = "2023-2024 Artur Barseghyan"
Expand Down
7 changes: 5 additions & 2 deletions fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
get_origin,
get_type_hints,
)
from unittest.mock import patch, MagicMock
from unittest.mock import MagicMock, patch
from uuid import UUID

__title__ = "fake.py"
Expand Down Expand Up @@ -2020,7 +2020,10 @@ def free_email_domain(self) -> str:
def email(self, domain_names: Optional[Tuple[str, ...]] = None) -> str:
"""Generate a random email."""
domain = random.choice(domain_names) if domain_names else None
return f"{'.'.join(_w.lower() for _w in self.words(3))}@{domain or self.domain_name()}"
return (
f"{'.'.join(_w.lower() for _w in self.words(3))}"
f"@{domain or self.domain_name()}"
)

@provider(tags=("Internet",))
def company_email(
Expand Down
28 changes: 25 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,18 @@ line-length = 80
lint.select = ["E", "F", "I"]
lint.ignore = []
# Enable autofix for formatting and import sorting
lint.fix = true
fix = true
src = [
"examples/customization",
"examples/dataclasses",
"examples/django",
"examples/hypothesis",
"examples/lazyfuzzy",
"examples/pydantic",
"examples/sqlalchemy",
"examples/sqlmodel",
"examples/tortoise",
]

# Exclude a variety of commonly ignored directories.
exclude = [
Expand Down Expand Up @@ -153,8 +164,19 @@ lint.per-file-ignores = {}
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.8.
target-version = "py38"
# Assume Python 3.9.
target-version = "py39"

[tool.ruff.lint.isort]
known-first-party = [
"address",
"article",
"config",
"data",
"fake_address",
"fake_band",
]
known-third-party = []

[tool.doc8]
ignore-path = [
Expand Down

0 comments on commit bbf4815

Please sign in to comment.