Skip to content

refactor: migrate lint tool from isort+black to ruff and apply future style type hints#128

Merged
long2ice merged 6 commits intolong2ice:devfrom
waketzheng:use-ruff
Jun 6, 2025
Merged

refactor: migrate lint tool from isort+black to ruff and apply future style type hints#128
long2ice merged 6 commits intolong2ice:devfrom
waketzheng:use-ruff

Conversation

@waketzheng
Copy link
Contributor

Description

Base on #125

  1. [tool.ruff.lint] section was copied from tortoise/pypika-tortoise
  2. add 'from future import annotations' by this script:
from pathlib import Path


for p in Path('asyncmy').rglob('*.py'):
    s = p.read_text()
    if 'from typing ' not in s and 'import typing' not in s:
        continue
    t = 'from __future__ import annotations'
    if t in s:
        continue
    p.write_text(t+'\n'+s)
    print(p, 'updated!')
  1. auto change code by: ruff check --fix --unsafe-fixes asyncmy && make style && make _check
  2. upgrade deps by: make up

@long2ice
Copy link
Owner

long2ice commented Jun 6, 2025

Thanks!

@long2ice long2ice merged commit dbbaaab into long2ice:dev Jun 6, 2025
10 checks passed
@waketzheng waketzheng deleted the use-ruff branch June 7, 2025 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants