Skip to content

Conversation

@jk-ozlabs
Copy link
Member

We're using the meson clang-format infrastructure to check C code, but have no equivalent for the python under tests/

This PR uses ruff to lint (and contains fixes for existing warnings) and format, and adds to the default PR action.

    F821 Undefined name `a`
       --> tests/mctpenv/__init__.py:348:52
        |
    346 |                 await self.handle_mctp_control(sock, addr, data)
    347 |             else:
    348 |                 print(f"unknown MCTP message type {a.type}")
        |                                                    ^
    349 |         else:
    350 |             for br_ep in self.bridged_eps:
        |

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Fix ruff lint F401.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Fix ruff lint E703.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Fix ruff lint F841.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Fix ruff lint E711.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Docstrings should be within the block they document. Move and reformat
with no leading space, and multi-line strings should have their
closing-triple-quote on its own line.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Now that we have lints passing, add a basic ruff.toml configuration, and
reformat accordingly.

We leave the quote-style as-is, but may unify this later.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
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