Skip to content

Make make lint a no-op on a fresh checkout - #45

Open
zlexdev wants to merge 1 commit into
funpayhub:devfrom
zlexdev:chore/lint-clean
Open

Make make lint a no-op on a fresh checkout#45
zlexdev wants to merge 1 commit into
funpayhub:devfrom
zlexdev:chore/lint-clean

Conversation

@zlexdev

@zlexdev zlexdev commented Aug 30, 2026

Copy link
Copy Markdown

make lint is ruff check --fix $(SRC), against this repository's own [tool.ruff] config. On a clean clone of dev it is not a no-op:

$ ruff check funpaybotengine --output-format=concise
funpaybotengine/client/bot.py:6:1: I001 Import block is un-sorted or un-formatted
funpaybotengine/client/bot.py:605:100: E501 Line too long (120 > 99)
funpaybotengine/exceptions/method_exceptions.py:1:1: I002 Missing required import: `from __future__ import annotations`
funpaybotengine/methods/__init__.py:1:1: I001 Import block is un-sorted or un-formatted
funpaybotengine/methods/raise_offers.py:6:1: I001 Import block is un-sorted or un-formatted
funpaybotengine/methods/save_offer_fields.py:6:1: I001 Import block is un-sorted or un-formatted
funpaybotengine/methods/save_offer_fields.py:65:27: C416 Unnecessary dict comprehension
funpaybotengine/runner/event_collector.py:327:100: E501 Line too long (100 > 99)
funpaybotengine/types/__init__.py:1:1: I001 Import block is un-sorted or un-formatted
funpaybotengine/types/calc.py:19:100: E501 Line too long (100 > 99)
funpaybotengine/types/offers.py:129:100: E501 Line too long (102 > 99)
funpaybotengine/types/pages/__init__.py:1:1: I001 Import block is un-sorted or un-formatted
Found 14 errors.

make dev runs pre-commit install, so a contributor touching any of these files gets the rewrites mixed into their own diff.

Twelve of the fourteen are fixed here. The one non-mechanical change:

# methods/save_offer_fields.py:65 -- fields is list[list[str, str]]
fields_dict = {field: error for field, error in fields}

dict(fields) is the same mapping for a sequence of pairs, and the surrounding try is untouched.

Two left in place

E722 in methods/refund.py#44 changes those same lines for a behavioural reason, so touching them here would only make a conflict.

RET503 in runner/event_collector.py:95attempts reaches the end of its loop only when amount is negative:

attempts = amount or float('inf')
while attempts:
    attempts -= 1
    try:
        return await func(*args, **kwargs)
    except UnauthorizedError:
        raise
    except UnexpectedHTTPStatusError:
        if not attempts:
            raise

With amount=-1 the counter goes -2, -3, …, not attempts is never true, and the call retries forever. Silencing the lint with a bare return None would hide that; it is a behaviour question and belongs in its own change.

Not in scope

ruff format wants 107 of 122 files. That is a separate decision and would conflict with anything currently in flight.

Checked

All 106 modules import cleanly after the change; there is no test suite on dev to run.

`ruff check --fix funpaybotengine` -- the repository's own lint target,
against its own `[tool.ruff]` config -- rewrites eight import blocks and
leaves five findings on a clean clone of `dev`. With `pre-commit` installed
as `make dev` prescribes, those land as unrelated noise in the next
contributor's diff.

Two findings are deliberately left:

* `E722` in `methods/refund.py` -- carried by funpayhub#44, which changes the same
  lines for a behavioural reason.
* `RET503` in `runner/event_collector.py` -- the `attempts` decorator falls
  out of its loop only when `amount` is negative, and then it retries
  forever rather than returning `None`. That is a behaviour question, not
  a lint one.

`ruff format` is also out of scope: it wants 107 of 122 files, which would
conflict with anything currently in flight.
@zlexdev
zlexdev requested a review from qvvonk as a code owner August 30, 2026 13:04
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