Skip to content

Commit

Permalink
Merge pull request #48 from grillazz/41-add-ruff-to-lint-codebase
Browse files Browse the repository at this point in the history
41 add ruff to lint codebase
  • Loading branch information
grillazz authored Apr 5, 2024
2 parents 37cbb87 + 3161e87 commit a2f1793
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 103 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ mypy: ## mypy check.
mypy --ignore-missing-imports .

.PHONY: lint
flake8: ## flake8 check.
flake8 .
lint: ## Lint project code.
poetry run ruff check --fix .

.PHONY: safety
safety: ## apply safety check in project.
Expand Down
2 changes: 1 addition & 1 deletion greens/schemas/vegs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from bson import ObjectId as _ObjectId
from pydantic import BaseModel, ConfigDict, BeforeValidator
from typing_extensions import Annotated
from typing import Annotated


# def check_object_id(value: str) -> str:
Expand Down
123 changes: 27 additions & 96 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 36 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,44 @@ pytest = "^8.1.1"
pytest-cov = "^5.0.0"
httpx = "^0.27.0"
rich = "^13.7.1"
black = "^24.3.0"
isort = "^5.12.0"
uvloop = "^0.19.0"
httptools = "^0.6.1"
ruff = "^0.3.5"

[build-system]
requires = ["poetry-core"]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
line-length = 120
indent-width = 4

lint.select = ["E", "F", "UP", "N", "C", "B"]
lint.ignore = ["E501"]

# Assume Python 3.12
target-version = "py312"

[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"

[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["fastapi.Depends",]

[tool.pytest.ini_options]
addopts = "-v --doctest-modules --doctest-glob=*.md --cov=. --cov-report html:htmlcov --cov-report=term-missing"
asyncio_mode = "strict"
env_files = [".env"]

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import AsyncGenerator
from collections.abc import AsyncGenerator

import pytest
from httpx import AsyncClient
Expand Down

0 comments on commit a2f1793

Please sign in to comment.