News for hackers. Stuff that matters.
Re:Formatting code should be unnecessary by HelloNurse on Monday September 08, 2025 @03:53AM (#45165659)
And best practices depend.

Recently, I discovered that the ruff linter for Python doesn't like the assert statement, because since it does nothing in "optimized" mode it isn't reliable. But such complaints about unit tests are not particularly useful.

Re:Formatting code should be unnecessary by mr_mitm on Monday September 08, 2025 @04:09AM (#45165775)
Rule S101 [1] is not in the default settings. If you choose to enable it, you have the possibility of disabling it for your tests like so:

    [tool.ruff.lint.per-file-ignores]
    "tests/*" = ["S101"]
(Besides, this was about formatting, not linting, but I realize it's related.)

[1] https://docs.astral.sh/ruff/rules/