Skip to content

Add ruff rules for Pylint, Refurb, and type hints#35

Open
cclauss wants to merge 1 commit intostarfederation:developfrom
cclauss:more-ruff
Open

Add ruff rules for Pylint, Refurb, and type hints#35
cclauss wants to merge 1 commit intostarfederation:developfrom
cclauss:more-ruff

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Mar 5, 2026

Add ruff rules for datetimes, Pylint, refurb, slots, type hints, and ensure each comment matches the output of the command:
% ruff linter


Before:
% ruff check --output-format=concise

examples/django/ds/views.py:49:81: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/django/ds/views.py:60:45: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/django/ds/views.py:64:36: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/django/ds/views.py:109:81: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/django/ds/views.py:116:45: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/django/ds/views.py:120:36: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/django/manage.py:12:9: PLC0415 `import` should be at the top-level of a file
examples/fastapi/app.py:64:76: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/fastapi/app.py:70:41: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/fastapi/app.py:74:32: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/fasthtml/advanced.py:106:30: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/fasthtml/advanced.py:155:34: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/fasthtml/simple.py:38:30: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/fasthtml/simple.py:59:34: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/litestar/app.py:63:63: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/litestar/app.py:69:41: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/litestar/app.py:73:32: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/quart/app.py:67:45: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/quart/app.py:71:36: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/quart/app.py:80:63: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/sanic/app.py:65:68: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/sanic/app.py:89:41: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/sanic/app.py:111:45: DTZ005 `datetime.datetime.now()` called without a `tz` argument
examples/sanic/app.py:120:36: DTZ005 `datetime.datetime.now()` called without a `tz` argument
src/datastar_py/attributes.py:130:23: FURB110 [*] Replace ternary `if` expression with `or` operator
src/datastar_py/attributes.py:136:24: FURB110 [*] Replace ternary `if` expression with `or` operator
src/datastar_py/attributes.py:155:21: FURB110 [*] Replace ternary `if` expression with `or` operator
src/datastar_py/attributes.py:164:23: FURB110 [*] Replace ternary `if` expression with `or` operator
src/datastar_py/attributes.py:219:22: FURB110 [*] Replace ternary `if` expression with `or` operator
src/datastar_py/attributes.py:636:34: PYI041 [*] Use `float` instead of `int | float`
src/datastar_py/sanic.py:46:37: PLR2004 Magic value used in comparison, consider replacing `204` with a constant variable
src/datastar_py/sse.py:8:8: PLR0402 [*] Use `from datastar_py import consts` in lieu of alias
src/datastar_py/sse.py:30:7: SLOT000 Subclasses of `str` should define `__slots__`
src/datastar_py/sse.py:86:9: PLR0913 Too many arguments in function definition (7 > 5)
Found 34 errors.
[*] 7 fixable with the `--fix` option.

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.

1 participant