Skip to content

Commit

Permalink
Add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
notarious2 committed Mar 3, 2024
1 parent 6cda453 commit c01d960
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 14 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint and Tests

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
# Update output format to enable automatic inline annotations.
- name: Run Ruff
run: ruff check --output-format=github .
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ repos:
hooks:
- id: flake8
exclude: "src/tests/"
additional_dependencies: [Flake8-pyproject]
additional_dependencies: [Flake8-pyproject]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.0
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
40 changes: 28 additions & 12 deletions poetry.lock

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

14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readme = "README.md"


[tool.poetry.dependencies]
python = "3.11.6"
python = "3.11.3"
fastapi = "^0.103.1"
pydantic = {extras = ["email"], version = "^2.3.0"}
uvicorn = "^0.23.2"
Expand All @@ -34,6 +34,7 @@ Pillow = "10.1.0"
sentry-sdk = {extras = ["asyncpg", "fastapi"], version = "^1.39.1"}



[tool.poetry.group.dev.dependencies]
pytest = "^7.4.2"
isort = "^5.12.0"
Expand All @@ -43,11 +44,21 @@ flake8-pyproject = "^1.2.3"
pytest-asyncio = "^0.21.1"
pytest-env = "^1.0.1"
pytest-mock = "^3.11.1"
ruff = "0.3.0"


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

[tool.ruff]
line-length = 120

[tool.ruff.lint]
extend-select = ["W", "E", "I"]
preview = true


[tool.black]
line-length = 120

Expand All @@ -58,6 +69,7 @@ skip_glob = ["**/migrations/**"]

[tool.flake8]
max-line-length = 120
exclude = ["tests"]

[tool.pytest.ini_options]
filterwarnings = ["ignore::DeprecationWarning"]
Expand Down

0 comments on commit c01d960

Please sign in to comment.