Skip to content

style(qa): use ruff for linting and formatting#51

Merged
wbarnha merged 2 commits into
faust-streaming:masterfrom
manawasp:style/switch-lint-and-format-to-ruff
Mar 2, 2024
Merged

style(qa): use ruff for linting and formatting#51
wbarnha merged 2 commits into
faust-streaming:masterfrom
manawasp:style/switch-lint-and-format-to-ruff

Conversation

@manawasp

@manawasp manawasp commented Feb 27, 2024

Copy link
Copy Markdown

Hey,

Following the proposal here this PR proposal switch linter and formatter to ruff:

  • Updated .gitignore following the one here: marcosschroh/python-schema-registry-client

  • Updated: tox.init / Makefile / pre-commit

  • Applied linter & formatter:

    • Most changes are about type mismatch my_var: str = None => my_var: Optional[str] = None

    • Drop unused # noqa rules

    • Regrouped some requirements under the dev.txt

    • Some formatting note:

      def __delitem__(self, i: int) -> None: ...

      will be changed to

      def __delitem__(self, i: int) -> None:
          ...

      The first formatting version was introduced by black 2024 version (~ a month ago), ruff will support this soon. In my opinion just following the chosen tool available features, going backward then forward is fine.


    1. I used ruff.toml for the configuration instead of the pyproject.toml, I prefer to provide a dedicated PR to regroup all configuration under the pyproject.toml.
    2. I see the initial line-length setup is 79, black/ruff default line length is 88 I would tend to match this, but before applying this I would like to know your opinion.
    3. Also I would tend to have less requirements files default.txt, test.txt, docs.txt:
      • dev.txt => test.txt (I believe which people setup development will also need the test environment)
      • ci.txt => test.txt (just containing pytest-cov)
      • dist.txt => test.txt & docs.txt, not totally sure if possible as I see wheel, twine & packaging inside.

@wbarnha

wbarnha commented Feb 27, 2024

Copy link
Copy Markdown
Member

I love ruff, let's do it! I'll review the PR but otherwise everything looks good so far.

@wbarnha wbarnha merged commit b4fc9e6 into faust-streaming:master Mar 2, 2024
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.

2 participants