Skip to content

Commit

Permalink
switch flake8->ruff (pydantic#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Nov 16, 2022
1 parent 1900f4a commit bfe2d13
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DEFAULT_GOAL := all
isort = isort pydantic_core tests generate_self_schema.py
black = black pydantic_core tests generate_self_schema.py wasm-preview/run_tests.py
ruff = ruff pydantic_core tests generate_self_schema.py wasm-preview/run_tests.py

.PHONY: install
install:
Expand Down Expand Up @@ -48,13 +49,14 @@ build-wasm:

.PHONY: format
format:
$(ruff) --fix
$(isort)
$(black)
cargo fmt

.PHONY: lint-python
lint-python:
flake8 --max-line-length 120 pydantic_core tests generate_self_schema.py wasm-preview/run_tests.py
$(ruff)
$(isort) --check-only --df
$(black) --check --diff

Expand Down
2 changes: 1 addition & 1 deletion pydantic_core/_pydantic_core.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import decimal
import sys
from typing import Any, Literal, TypedDict
from typing import Any, TypedDict

from pydantic_core.core_schema import CoreConfig, CoreSchema, ErrorType

Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Source = 'https://github.com/pydantic/pydantic-core'
bindings = 'pyo3'
sdist-include = ['Cargo.lock']

[tool.ruff]
line-length = 120
extend-select = ['Q']
flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'}

[tool.pytest.ini_options]
testpaths = 'tests'
log_format = '%(name)s %(levelname)s: %(message)s'
Expand Down
3 changes: 1 addition & 2 deletions tests/requirements-linting.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
black==22.3.0
flake8==4.0.1
flake8-quotes==3.3.1
ruff==0.0.122
isort[colors]==5.10.1
pyright==1.1.246
pycodestyle==2.8.0
Expand Down
2 changes: 1 addition & 1 deletion wasm-preview/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def main(tests_zip: str, tag_name: str):


try:
await main(tests_zip, tag_name) # noqa: F704
await main(tests_zip, tag_name) # noqa: F821,F704
except Exception:
traceback.print_exc()
raise

0 comments on commit bfe2d13

Please sign in to comment.